Page 1 of 1

Field[x].DataType returns wrong values

Posted: Thu 17 Mar 2011 11:59
by ralfiii
I am just converting an application from IBX to IbDAC.
There's a Grid-component that uses the datatype property of a field to determine what's in the field -> how to display the data.

Depending on the type it displays:
*) strings (ftString, ftWideString) are simply displayed
*) for Text-Blobs (ftMemo) a symbol for Blob-Text is displayed
*) normal Blobs (ftBlob) are displayed as graphic

Works fine with IBX (tested on same database & table), but IBDac doesn't return ftMemo for Text-Blobs. It always returns ftBlob for both Blob-types (binary and text).

Help!

Posted: Thu 17 Mar 2011 12:42
by AndreyZ
Hello,

You should set the TIBCConnection.Options.EnableMemos option to True. This option is used to enable creating TMemoField and TWideMemoField for BLOB fields with subtype 1.

Posted: Thu 17 Mar 2011 13:25
by ralfiii
AndreyZ wrote:You should set the TIBCConnection.Options.EnableMemos option to True. This option is used to enable creating TMemoField and TWideMemoField for BLOB fields with subtype 1.
Super, that solved the problem :D
Thanks!!!

One question remains: If this property is there to support creating Text-Blobs, why does it affect READING from an existing table?

Posted: Thu 17 Mar 2011 15:31
by AndreyZ
When you are opening an existing table, the dataset component creates fields for BLOB TEXT columns. Depending on the EnableMemos option value, it will be either TBlobField (ftBlob) or TMemoField (ftMemo).

Posted: Thu 17 Mar 2011 15:38
by ralfiii
AndreyZ wrote:When you are opening an existing table, the dataset component creates fields for BLOB TEXT columns. Depending on the EnableMemos option value, it will be either TBlobField (ftBlob) or TMemoField (ftMemo).
Maybe consider changing the default settings.
I guess most developers expect a Blob-Field with Subtype Text to result in a Memo-Field.
(For me the problem is solved now, I'm just thinking about future customers)

Posted: Fri 18 Mar 2011 08:32
by AndreyZ
We will investigate this question. As soon as we get any results, we will let you know.