DefinedSize property of Field object

L

Lorenzo Bolognini

Hi all,

why is the DefinedSize of the Field object of type adInteger returning the
value 4 and the same property on a adVarWChar type field (Text in MS Access)
is returning the max length of the string that it may contain (for example
52)?

I'm using ADO 2.8

Thank You,
Lorenzo
 
B

Bob Barrows

Lorenzo said:
Hi all,

why is the DefinedSize of the Field object of type adInteger
returning the value 4 and the same property on a adVarWChar type
field (Text in MS Access) is returning the max length of the string
that it may contain (for example 52)?

I'm using ADO 2.8

Thank You,
Lorenzo

Because it takes four bytes (32 bits) to hold the largest available integer
value (2,147,xxx,xxx - I haven't memorized this one - you can look it up if
you're so inclined).

Don't forget, unicode (adVarWChar) takes twice the characters to store the
same data as non-unicode types (adVarChar).
 
L

Lorenzo Bolognini

Bob Barrows said:
Because it takes four bytes (32 bits) to hold the largest available integer
value (2,147,xxx,xxx - I haven't memorized this one - you can look it up if
you're so inclined).

I did imagine something like that but why is the return type of the
DefinedSize of a different type for the two types of field (text and
integer)? Does that make sense?

Thank You for your help,
Lorenzo
 
B

Bob Barrows

Lorenzo said:
I did imagine something like that but why is the return type of the
DefinedSize of a different type for the two types of field (text and
integer)? Does that make sense?

Thank You for your help,
Lorenzo

Why wouldn't it be? I don't understand the question. The defined size of an
integer field has to be 4. The defined size of a Text field is whatever the
size is defined to be in the database.

Bob Barrows
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top