Subject Re: [IBO] Requested change to IBODataset unit
Author Daniel Rail
Hi,

At September 5, 2003, 19:41, Matt Nielsen wrote:
> Here is the piece of code I'm talking about:

> begin
> NewDataType := ftBytes;
> NewDataSize := SQLLen;
> end
> else
>>>>>>>>>>>>> HERE <<<<<<<<<<<<<<<<<<<
> if SQLLen >= 256 then
> NewDataType := ftMemo
>>>>>>>>>> JUST ADD <<<<<<<<<<<<<<<<<<<<
> NewDataSize := SQLLen;
> else
> begin
> NewDataType := ftString;
> NewDataSize := SQLLen;
> // The vcl complains about zero length strings...
> if NewDataSize = 0 then
> NewDataSize := 1;
> end;

Did you test this change yourself?

Here's the definition in Delphi's help for the Size property, in
regards to TFieldDef.Type:=ftMemo:
"For a BLOB, memo, or graphic field, Size is the number of bytes from
the field’s value that are stored in the actual database table."

I think this is change that can be introduced:

begin
NewDataType := ftBytes;
NewDataSize := SQLLen;
end
else
// Maximum String length defined in Delphi.
if SQLLen >= 8192 then
NewDataType := ftMemo
NewDataSize := SQLLen;
else
begin
NewDataType := ftString;
NewDataSize := SQLLen;
// The vcl complains about zero length strings...
if NewDataSize = 0 then
NewDataSize := 1;
end;

I don't know in which version of Delphi the maximum length was
augmented, but I know it is the same between Delphi 5, 6 and 7. So it
would be safe to make this modification.

For Jason, the line in question is located in "procedure
GetDataTypeAndSize" at approximately line number 2462.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)