Subject BLOBS to Stream's with IBO
Author Chris Hulsey
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@...



[Non-text portions of this message have been removed]