Page 1 of 1

Problem with Streamed-JPEG and Blob-Field

Posted: Tue 15 Jul 2008 20:59
by Grolle
Hi,

i try to insert an Jpeg-Image in a Blob-Field. Here is my source:

Code: Select all

  if main.Image3  nil then
  begin
    img := TJPEGImage.Create;
    img.Assign(main.Image3.Picture.Bitmap);
    s := TMemoryStream.Create;
    img.SaveToStream(s);
    s.Position := 0;
    ContactsQuery.ParamByName('P33').LoadFromStream(s, TBlobType(0));
    FreeAndNil(img);
  end;
  ContactsQuery.ExecSQL;
but I get the message "Data type is not supported". What am I doing wrong?

Best regards ...

Posted: Wed 16 Jul 2008 07:09
by Plash
You should pass ftBlob instead of TBlobType(0) to the LoadFromStream procedure.