Subject Re: [IBO] How to pass a stream into a blob field?
Author Helen Borrie
At 10:37 PM 21/04/2003 +0200, you wrote:
>Hi all.
>I am dealing with the now open source Lock Box of Infopower.
>The RSA component has a property StoreToStream eg
>TS :TStream;
>..... snip .....
>RSA.PublicKey.StoreToStream( TS );
>So I have the keys stored in a TStream object. The problem rises when I
>must pass the contents of TS to a blob field
>declared as SUBTYPE 0.
>I have read the previous mail regarding blob, but no light.

First, you should store PGP keys as a text type (SUB_TYPE 1) if you want to
be able to search the blob...

Anyway, here are a few clues:

Using a TIB_ data access object:

MyIB_Query.FieldByName('MyBlob').Assign (MyStream);

If you are using the TDataset-compatible components, e.g. TIBOQuery, you
can use the LoadFromStream method on the blob's field object:


Did you know that, if you are using Firebird, you can assign the string
directly to a Blob (doesn't work for InterBase).

MyQuery.FieldByName('MyBlob').AsString := MyString;