Subject Re: [IBO] BLOBS to Stream's with IBO
Author Jason Wharton
If you are converting from the BDE, I would like to make sure you know that
it is easiest to convert to the TIBO stuff which is based on TDataset.

Secondly, you cannot use the TBlobStream class. This is directly tied to the
BDE. You need to use the TDataset.CreateBlobStream( ) method.

HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Chris Hulsey" <chulsey@...>
To: <IBObjects@yahoogroups.com>
Sent: Wednesday, March 21, 2001 4:35 PM
Subject: [IBO] BLOBS to Stream's with IBO


> Hello All,
>
> I am converting some parts of my application over to IBO from the BDE and
I am having trouble with the TIB_Query
> control. I have a BLOB column in my database that contains JPEG's within
a particular record. Before with the BDE and TQuery I was able to
successfully read the data into a TImage control using the SaveToStream()
function. But now I get an error when converting to IBO and TIB_Query. Here
is my sample code:
>
>
> // Load the Picture from the Database
> void __fastcall TForm1::LoadClientPicture(TImage *ClientPicture)
> {
> TJPEGImage *Jpg = new TJPEGImage();
> TMemoryStream *S = new TMemoryStream();
>
>
((TBlobField*)Query_ClientInformation->FieldByName("PICTURE"))->SaveToStream
(S);
> try
> {
> S->Position = 0;
> if (S->Size > 0)
> {
> Jpg->LoadFromStream(S);
> ClientPicture->Picture->Assign(Jpg);
> }
> else
>
ClientPicture->Picture->LoadFromFile("C:\\Pictures\\BLANKPICTURE.JPG");
> }
> __finally
> {
> delete Jpg;
> delete S;
> }
> }
>
> This works fine when Query_Information is a TQuery but does not work when
TIB_Query. I get a access violation error. I am using the Borland C++
Builder 5.0 Enteprise Edition with Interbase 6.0
>
> Thanks in advance for any help!!!
>
> Chris Hulsey
> Visible Changes, Inc.
> chulsey@...