首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

Delphi传入null的有关问题

2013-10-01 
Delphi传入null的问题function Video_State(phot:string):stringvarworkpath:stringCatr_img:stringbeg

Delphi传入null的问题

function Video_State(phot:string):string;
var
  workpath:string;
  Catr_img:string;
begin
  workpath:=ExtractFilePath(Application.ExeName);
  if hWndC <> 0 then begin
    SendMessage(hWndC,WM_CAP_SAVEDIB,0,LongInt(PChar(workpath+'photop_sp\'+phot+'.png')));
    Catr_img:=workpath+'photop_sp\'+phot+'.png';
  end;
   Result:=Catr_img;
end;
 //存储身份证图片
function SaveAsJPG(cardimg:TImage;phot_cart:string):string;
var

  img_cardstp:string;
  img:string;
begin
   img:=ExtractFilePath(Application.ExeName);
   cardimg.Picture.SaveToFile(img+'photop_card\'+phot_cart+'.png');
   img_cardstp:=img+'photop_card\'+phot_cart+'.png';
   Result:=img_cardstp;
end;


它们两个在存入数据库的值,不同,同样的情况。都没有图片。一个数据库显示null  一个显示空白,
[解决办法]
 

//第一种:
var
  strSQL: string;
begin
  strSQL := 'INSERT INTO TEST(Image)VALUES(NULL)';  //用SQL语句
end;

//第二种:
uses DB;
begin 
 AdoQuery.FieldByName('Image').value = null;
end;

热点排行