W
wang5793
Unregistered / Unconfirmed
GUEST, unregistred user!
我在做一个C/S数据库,涉及到将Jpeg图片存入和从库中读出,先做了一个子程序全部能正常存取.重新做一个子程序时却报错"Jpeg error #53".但在先的子程序又是完全正常的.谢谢各位的指教了.代码如下:<br>var <br> mStream:TMemoryStream; <br> JpgFile:TjpegImage;<br>begin<br> With ADOQuery1 Do<br> Begin<br> Close;<br> SQL.Clear;<br> SQL.Text:='select * from tempdb';<br> Open;<br> End;<br> if not ADOQuery1.FieldByName('photo').IsNull then<br> begin <br> mStream:=TMemoryStream.Create ;<br> JpgFile:=TjpegImage.Create ;<br> TBlobField(ADOQuery1.FieldByName('photo')).SaveToStream(mStream);<br> mStream.Position :=0;<br> jpgfile.LoadFromStream(MStream);<br> fcImager1.Picture.Assign(JpgFile);<br> MStream.Free;<br> jpgfile.Free;<br> end<br> else<br> begin<br> image1.Picture :=nil;<br> End; <br>end;