Re: Saving JPEG images to images field in SQL2000 with ADODataSet



Hi Martin,

It doesn't work. According to help file, I read that SaveToStream function
is saving contents of the Blob to a stream variabel.

Thanks
Wira



"Martin Cremer" <Martin..Cremer@xxxxxx> wrote in message
news:44911779$1@xxxxxxxxxxxxxxxxxxxxxxxxx
How abaout SaveToStream(FStream)

Cheers

Martin Cremer



"Wira" <wira@xxxxxxxxxxxxxxxx> schrieb im Newsbeitrag
news:4490f687@xxxxxxxxxxxxxxxxxxxxxxxxx
I'm Using D5 and SQL2000 for database.
One of my tables in SQL2000 have an image field type for saving picture
,
the problem is when I want to save JPEG images into my table always
appear
error message "Bitmap image is not valid".


procedure SavePicture ;
var FStream : TMemoryStream ;
begin
with tblPicture do begin //tblPicture is ADODataSet Component
try
Insert ;
FStream := TMemoryStream.Create ;
FStream.LoadFromFile('C:\PictureFiles\Image01.JPG') ;

TBlobField(FieldByName('im_pic_thumbnail')).LoadFromStream(FStream)
;
Post ;
finally
FStream.Free
end;
end;
end;



Thanks

Wira






.