473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

DefinedSize property of Field object

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
Jul 19 '05 #1
3 3145
Lorenzo Bolognini wrote:
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).
Jul 19 '05 #2
"Bob Barrows" <re******@NOyahoo.SPAMcom> ha scritto nel messaggio
news:%2****************@TK2MSFTNGP11.phx.gbl...
Lorenzo Bolognini wrote:
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)?

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
Jul 19 '05 #3
Lorenzo Bolognini wrote:
"Bob Barrows" <re******@NOyahoo.SPAMcom> ha scritto nel messaggio
news:%2****************@TK2MSFTNGP11.phx.gbl...
Lorenzo Bolognini wrote:
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)?


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


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
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Georg Scholz | last post by:
Hello, The class "Control" contains a documented Property "ControlType". So for example, in a form, you can write code like this: Dim c as control set c = me.Controls("textbox1") if...
1
by: windandwaves | last post by:
Hi Folk I am working with the TYPE property. I want to change that from 2 (byte) to 4 (long integer) for a field that already contains tons of data. How can I do that? The help reads: ...
2
by: Andrzej Kaczmarczyk | last post by:
Hi, I have following problem: (warning, quite long post with lots of code) I have an object of a known type like this. class MyClass { public int Property1; public string Property2; }
1
by: kevin_g_frey | last post by:
Hello All, I have an MC++ class named "Person" which encapsulates access to a database entity and it contains a number of field properties eg. Code, Name, Address, Suburb etc. Each of the...
9
by: Stefan De Schepper | last post by:
Should I use: Private m_Name As String Public Property Name() As String Get Return m_Name End Get Set(ByVal Value As String) m_Name = Value
3
by: Mark Jones | last post by:
I am quite new to ASP and .Net development and I am building a web-based multiple choice exam application. The web page displays the questions using a Repeater control and the answers are nested...
6
by: Bob Darlington | last post by:
I want to use the caption property for fields in a recordset as a condition in a loop. That is, I only want to consider those fields which have captions: For each fld in RecordsetName.Fields If...
4
by: Internet User | last post by:
What is the definition of a field in VB.net (other than database functions)? How does one distinguish between a "field" and a "property"? Or are fields and properties related to each other in some...
12
by: andrew cooke | last post by:
Hi, This is my first attempt at new classes and dynamic python, so I am probably doing something very stupid... After reading the how-to for descriptors at...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.