Set the DataSize of a field

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
PiSymbol
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 10.04.2006, 19:22

Set the DataSize of a field

Post by PiSymbol »

Dear visitors,

I'm trying to receive data from a MS-SQL database. The problem is in the size of the data. The datasize is set to 256 while the data contains more than 256 characters. How do I set the 'DataSize' of a field to 1000?

You can receive the datasize of a field using this source:

Code: Select all

ShowMessage(ZQuery1->Fields->FieldByNumber(i)->DataSize);
Thanks in advance
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

Use the BLOB type
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

I think Delphi/BCB has a limit of 255 for String type fields. For anything more than that you have to use Memo fields. I'm not sure of the mapping between strings in MSSql and Delphi field types.

Ben
PiSymbol
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 10.04.2006, 19:22

Post by PiSymbol »

Applications like SQLExecMS don't have any problems receiving fields containing more than 256 characters.

It's not a solution to use Memo fields or BLOB fields, because the data is added by someone else and he's using other software.
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

You have to define the memo/blob in your application. The problem is that your app is trying to read a 255 string instead a large memo. You have to define the fieldtype in the TDataset as memo or something like this (blob,... etc.) I'm not a MsSQL expert, so the datatype may vary on the server type.
Post Reply