用DBImage1连接上相应的表,查询就可以读出来了procedure TForm1.Button1Click(Sender: TObject);
begin//保存
if not image1.Picture.Bitmap.Empty then
begin
if Query1.Active then
begin
Query1.Insert ;
try
TBlobField(Query1.FieldByName('Image')).Assign(Image1.Picture.Bitmap);
Query1.Post ;
showmessage('Inserted!') ;
except
on E:exception do
begin
showmessage('err:'+e.Message) ;
Query1.Close ;
if application.MessageBox('要打开表吗?','打开',36)=6 then
query1.Open ;
end ; end; end; end ;
end;
begin//保存
if not image1.Picture.Bitmap.Empty then
begin
if Query1.Active then
begin
Query1.Insert ;
try
TBlobField(Query1.FieldByName('Image')).Assign(Image1.Picture.Bitmap);
Query1.Post ;
showmessage('Inserted!') ;
except
on E:exception do
begin
showmessage('err:'+e.Message) ;
Query1.Close ;
if application.MessageBox('要打开表吗?','打开',36)=6 then
query1.Open ;
end ; end; end; end ;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货