I would like load JPEG image into a blob field, is it possible? I search a lot but I don't find a clear answer.
I use this code:
var
BlobField : TBlobField;
Stream : TMemoryStream;
begin
BlobField := ClientDataSet1.FieldByName('image');
// Img is TImage and contain a JPEG image
Img.Picture.Graphic.SaveToStream(Stream);
Stream.Position := 0;
BlobField.LoadFromStream(Stream); // <-- Error: "Bitmap image is not valid"
I have to use bitmap image?
SOLVED: The problem was a TDBImage component on the form!. This component was linked to the field only for testing and since it work only with bitmat it give the error