C
computer751122
Unregistered / Unconfirmed
GUEST, unregistred user!
如题,说明:参数都己声明,且编译通过,ADODateSet1.Commandtext:='select * from Atable where id=:id'.
begin
dm1.ADODataSet1.Close;
DM1.ADODataset1.Parameters.ParamByName('id').Value:=edit1.Text;
DM1.ADODataSet1.Open;
tmpStream:=TMemoryStream.Create;
try //开始保存
DM1.ADODataset1.Edit;
tmpStream.LoadFromFile('d:/picture/aaa.bmp);
tmpstream.SaveToFile('c:/cc.bmp');//图片能保存到C:/cc.bmp中证明了图片己保存到Stream中
DM1.ADODataSet1.Edit;
TBlobfield(DM1.ADODataSet1.FieldByName('photo')).LoadFromStream(tmpstream);//关键好象是这句不起作用 !!
finally
tmpStream.Free;
end;
begin
dm1.ADODataSet1.Close;
DM1.ADODataset1.Parameters.ParamByName('id').Value:=edit1.Text;
DM1.ADODataSet1.Open;
tmpStream:=TMemoryStream.Create;
try //开始保存
DM1.ADODataset1.Edit;
tmpStream.LoadFromFile('d:/picture/aaa.bmp);
tmpstream.SaveToFile('c:/cc.bmp');//图片能保存到C:/cc.bmp中证明了图片己保存到Stream中
DM1.ADODataSet1.Edit;
TBlobfield(DM1.ADODataSet1.FieldByName('photo')).LoadFromStream(tmpstream);//关键好象是这句不起作用 !!
finally
tmpStream.Free;
end;