Problem with Streamed-JPEG and Blob-Field

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Grolle
Posts: 13
Joined: Tue 15 Apr 2008 12:02

Problem with Streamed-JPEG and Blob-Field

Post by Grolle » Tue 15 Jul 2008 20:59

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 ...

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 16 Jul 2008 07:09

You should pass ftBlob instead of TBlobType(0) to the LoadFromStream procedure.

Post Reply