数据库图片字段为OLE:代码如下
procedure TForm1.speedButton1click(sender:TObject)
var
Picture1:TPicture;
begin
Picture1:=TPicture.create;
if OpenpictureDialog1.Execute then
begin
ADOQuery1.edit;
Picture1.Loadfromfile(OpenPicturedialog1.filename);
ADOQuery1.fielByname('Opphoto').assign(picture1);
ADOQuery1.post;
picture1.free;
ADOQuery1.active:=false;
ADOQuery1.active:=ture;
end;
用这段代码为什么DBImage不显示图片,也保存不到数据库里?
procedure TForm1.speedButton1click(sender:TObject)
var
Picture1:TPicture;
begin
Picture1:=TPicture.create;
if OpenpictureDialog1.Execute then
begin
ADOQuery1.edit;
Picture1.Loadfromfile(OpenPicturedialog1.filename);
ADOQuery1.fielByname('Opphoto').assign(picture1);
ADOQuery1.post;
picture1.free;
ADOQuery1.active:=false;
ADOQuery1.active:=ture;
end;
用这段代码为什么DBImage不显示图片,也保存不到数据库里?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货