Subject Re: [ib-support] Please help -- ! Having problems inserting Text as Blob in Delphi
Author Helen Borrie
At 08:09 PM 18-08-01 +0200, you wrote:
>I have created a test table with a column of type BLOB SUBTYPE 1
>I want to insert the text in a memo into the blob field by doing this:
>Table.FieldByName('BLOB_COL').Value := Memo.Text;
>I get a 'Operation not applicable' error on the Post, and there is garbage
>in the table.
>Any ideas of how to do this?

You have to pass a blob, not a string.

You don't say what you are using for connectivity but, to do it in native Delphi, refer to the help for TBlobStream. Basically you create a writable blobstream for the field object and pass the text to it by calling its Write method.

If you have your text in a TDBMemo, you can stream the Lines property (a TStrings) directly into the blob using Lines.SaveToStream().

IB Objects provides some much more elegant ways to achieve it. If you are using IBO, try posting there.


All for Open and Open for All
InterBase Developer Initiative ยท