Board index » delphi » Varchar >255 as TStringField

Varchar >255 as TStringField

How can I tell BDE that I want it do define VARCHAR columns of width
more then 255 as TStringFields insted as TMemoFields.
I'm using Delphi 4, Oracle 8, Nt 4.0

Igor Zelic

 

Re:Varchar >255 as TStringField


Delph does not support tying a varchar > 255 chars to a tstringfield.
Max length of a tstringfield is 255 chars. Why? Because the value
property is defined as a Pascal string, and the max length of a Pascal
string is 255 characters plus one char at the beginning for length.

Juan

Quote
Igor Zelic wrote:

> How can I tell BDE that I want it do define VARCHAR columns of width
> more then 255 as TStringFields insted as TMemoFields.
> I'm using Delphi 4, Oracle 8, Nt 4.0

> Igor Zelic

Re:Varchar >255 as TStringField


You are wrong. From Delphi 3 (I don't known if 2) all VCL (at least all I
saw) code use huge strings. I inspect DB unit and DBTables (I wrote a
TDataSet descendant) and there is nothing to do with conversion from
TStringField to TMemoField when you use VARCHAR (>255). BDE is whom
determines the datatype.

Juan Jimenez escribi en mensaje <37BA0808.C4AB7...@home.com>...

Quote
>Delph does not support tying a varchar > 255 chars to a tstringfield.
>Max length of a tstringfield is 255 chars. Why? Because the value
>property is defined as a Pascal string, and the max length of a Pascal
>string is 255 characters plus one char at the beginning for length.

>Juan

>Igor Zelic wrote:

>> How can I tell BDE that I want it do define VARCHAR columns of width
>> more then 255 as TStringFields insted as TMemoFields.
>> I'm using Delphi 4, Oracle 8, Nt 4.0

>> Igor Zelic

Re:Varchar >255 as TStringField


You are quite correct. I forgot about $H+ as default.

I just figured out why it's not allowed. Max size of the value property
of tstringfield is defined as 8192 chars. A memofield can have more than
that. I believe that is why you can't set a tstringfield to point to a
memofield.

Juan

Quote
Sergio Samayoa wrote:

> You are wrong. From Delphi 3 (I don't known if 2) all VCL (at least all I
> saw) code use huge strings. I inspect DB unit and DBTables (I wrote a
> TDataSet descendant) and there is nothing to do with conversion from
> TStringField to TMemoField when you use VARCHAR (>255). BDE is whom
> determines the datatype.

> Juan Jimenez escribi en mensaje <37BA0808.C4AB7...@home.com>...
> >Delph does not support tying a varchar > 255 chars to a tstringfield.
> >Max length of a tstringfield is 255 chars. Why? Because the value
> >property is defined as a Pascal string, and the max length of a Pascal
> >string is 255 characters plus one char at the beginning for length.

> >Juan

Other Threads