I can not save a jpeg image to a image field. I use the following code:
TJPEGImage *jp;
....
TStream *Stream1=NULL;
Query->Edit();
Stream1 = Query->CreateBlobStream(Query->FieldByName("Logo"), bmWrite);
jp->SaveToStream(Stream1);
Query->Post();
I don't get an error message but there is nothing written to the database either. I am sure that jp holds the related image.
Can not save JPEG Image to Image Field
I had a similar problem, the following sequence solved it :
query.fieldbyname('MyBlobField').Clear; // i think THIS is it !
stream:=TBlobStream(q.CreateBlobStream(q.fieldByName('myBlobField'),bmWrite));
stream.Seek(0,soFromBeginning);
stream.Write(data,len); // should work with savetostream too
query.post
Maybe it can help
query.fieldbyname('MyBlobField').Clear; // i think THIS is it !
stream:=TBlobStream(q.CreateBlobStream(q.fieldByName('myBlobField'),bmWrite));
stream.Seek(0,soFromBeginning);
stream.Write(data,len); // should work with savetostream too
query.post
Maybe it can help