473,780 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3161
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******@NOyah oo.SPAMcom> ha scritto nel messaggio
news:%2******** ********@TK2MSF TNGP11.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******@NOyah oo.SPAMcom> ha scritto nel messaggio
news:%2******** ********@TK2MSF TNGP11.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
2794
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 c.ControlType = acTextBox then ...
1
1775
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: For a Field or Property object, this property is read/write until the object is appended to a collection or to another object, after which it's
2
1881
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
1369
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 field properties is of type "Field", so we have eg. __property Field* get_Code( ); __property Field* get_Name( );
9
8876
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
2556
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 within the Repeater as RadioButtonLists. Simple enough I think. My data consists of a Question table and an Answer table. The Question table has a QuestionID and a Question field. The Answer table has a AnswerID field, an Answer field and a...
6
3216
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 fld.Properties("Caption") <"" then do something The problem is that all fields are included, even those with no caption set. I've tried IsMissing, IsEmpty and IsNull for the test but none will filter
4
2256
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 way? Thanks in advance.
12
1705
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 http://users.rcn.com/python/download/Descriptor.htm I decided I would make an object that returns attributes on read, but on setting calls an arbitrary function. My code looks like: class ActiveDAO(object):
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10139
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9931
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6727
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.