往表t_photo(其中字段Photo为Blob类型)中添加数据时,
运行不报错,也能在表中看到新添加的记录,但Photo字段为空
Delphi程序如下:
imgStream := TMemoryStream.Create;
Image1.Picture.Graphic.SaveToStream(imgStream);
with ado_Query do begin
SQL.Clear;
SQL.Add('insert into t_photo (ID,Photo) values (:ID,:Photo));
Parameters.ParamByName('ID') := 1;
Parameters.ParamByName('Photo').LoadFromStream(imgStream,ftBlob);
ExecSQL;
end;
另外,执行select * from t_photo时会出错:数据类型不被支持
请问是什么原因,如何解决?谢谢. |