Subject Re: [IBO] READING AND WRITING BLOBS
Author Helen Borrie
At 09:48 AM 21/11/2008, you wrote:
>I have a Firebird 1.5.4 dialect 3 database ,mounted on a Visat PC,
>running Firebird 2.1, with binary information stored as BLOB SUBTYPE 2
>SEGMENT SIZE 4096 (from Ibexperts), I am using Delphi 2007, and using
>the ODBC connection (2.00.00.144) and the ADOdataset i can successfully
>stream the blob to a file (test.jpg) this work perfectly !
>
>But using the IBO Tdataset components TIBOQuery or TIBOTable the output
>is truncated. I am using IBO version 4.8.7
>
>How can i use my favorite Dataset components (IBO) to read these blobs.

First, never store blobs as sub_type 2!! It is a formalised text type reserved for use by the server. The same applies to **all** subtypes > 1. Sub_type 1 is text, Sub_type 0 is "just binary" and you can use any negative subtypes for anything you want, e.g., storing jpegs if you like. You might be getting truncation because the system expects blob sub_type 2 not to exceed the maximum size of a block of BLR, which is 64KB (or might be 48 KB, not large, anyway!)

How you go about retrieving and storing blobs with IBO depends on whether you are using the TIBO* components or the TIB_*. With the TIBO* it should be just the same as with TADODataset... TIB_ is a bit smarter about blobs but it sounds as though you're not looking for anything supersmart. ;-) (If you are, look at the methods and properties for TIB_ColumnBlob in the help.)

When you talk about "output", do you mean the display of the jpeg image? If so, then use TIB_JPEGImage for this. Unlike TImage, it knows what to do with jpegs...

Helen