第一个问题,将你的实现放到fromshow过程中看看。
第二个问题,要看看你存储图片的语句和读取图片并显示的语句才好说
第二个问题,要看看你存储图片的语句和读取图片并显示的语句才好说
解决方案 »
- 传SQL语句出错?大家进来帮帮忙?
- 急!怎样创建DLL调用数据库并返回记录集?
- 我有个很棘手的问题,大家帮帮忙。大家都来讲讲思路
- 散分!!!!!!!!!!!!!!!!!
- select title,sum(outquan) from xx group by title分类统计加序号的问题
- 熬到夜里仍然没有解决的问题!急!
- 在其它开发平台下调用 Delphi 编写的DLL问题
- 一条给力的新闻啊
- 接着上个问题接着问!!!!!
- 本地数据库编程时,BDE、ADO、ODBC哪个好用且应用比较广泛?请说出理由!
- 如何声明与使用动态二维数组?数组内存放string类型。
- delphi中客户端怎样把数据以数据封包的形式传递给服务器?
第二个问题,我要说的是,这段代码以前能实现但是现在却不能实现了
AdoConnection.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;User ID=admin;Data Source=' + ExtractFilePath(Application.ExeName) + 'xxxx.mdb';Persist Security Info=False';
AdoConnection.Connected := True;
2:保存和读取的代码贴出来看一看。
procedure SavePicture(const FileName: string);
begin
with AdoTable do
begin
Append;
....
....
TBlobField(FieldByName('Picture')).LoadFromFile(FileName);
Post;
end;
end;procedure SavePicture(const FileName: string);
begin
with AdoQuery do
begin
Sql.Clear;
Close;
Sql.Add('insert into tablename (Picture) values(:Picture)');
Parameters[0].LoadFromFile(FileName);
ExecSQL;
end;
end;//读取并显示
uses Jpeg;
procedure XXXXXX;
var
JpegImage: TJpegImage;
MS: TMemoryStream;
begin
MS := TMemoryStream.Create;
try
TBlobField(AdoTable1.FieldByName('Picture')).SaveToStream(MS);
MS.Position := 0;
if 位图 then
Image1.Picture.Bitmap.LoadFromStream(MS)
else if 图标 then
Image1.Picture.Icon.LoadFromStream(MS)
else if JPEG图像 then
begin
JpegImage := TJpegImage.Create;
try
JpegImage.LoadFromStream(MS);
Image1.Picture.Graphic := JpegImage;
finally
JpegImage.Free;
end;
end;
finally
MS.Free;
end;
end;
…………TBlobField(FieldByname('BCImage')).SaveToFile(FormMain.FAppDir + 'Image\temp.bmp');
Image1.Picture.LoadFromFile(FormMain.FAppDir + 'Image\temp.bmp');………………
这两句话就是将数据库中的图片存到硬盘中,再有Image读取显示出来,为什么以前用就没有问题,现在就不行了?