Field[x].DataType returns wrong values

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ralfiii
Posts: 25
Joined: Wed 16 Mar 2011 09:25

Field[x].DataType returns wrong values

Post by ralfiii » Thu 17 Mar 2011 11:59

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!

AndreyZ

Post by AndreyZ » Thu 17 Mar 2011 12:42

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.

ralfiii
Posts: 25
Joined: Wed 16 Mar 2011 09:25

Post by ralfiii » Thu 17 Mar 2011 13:25

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?

AndreyZ

Post by AndreyZ » Thu 17 Mar 2011 15:31

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).

ralfiii
Posts: 25
Joined: Wed 16 Mar 2011 09:25

Post by ralfiii » Thu 17 Mar 2011 15:38

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)

AndreyZ

Post by AndreyZ » Fri 18 Mar 2011 08:32

We will investigate this question. As soon as we get any results, we will let you know.

Post Reply