473,468 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Programmatically Determin Max Field Length

I'm trying to programmatically determine the maximum field length for
an Access table. I've had problems using the examples that I have come
across on the internet. Can anyone provide me with a simple way to
determine the max length of a field?

Thanks,
CR Junk

Sep 25 '06 #1
1 1485

crjunk wrote:
I'm trying to programmatically determine the maximum field length for
an Access table. I've had problems using the examples that I have come
across on the internet. Can anyone provide me with a simple way to
determine the max length of a field?

Thanks,
CR Junk
I was able to obtain the maximum field lenght by using the following
code:

Dim tmpML as String
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM
MyInfo WHERE 1 = 0", objConn)
Dim daMaxLength As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim myDataSet As DataSet
myDataSet = New DataSet
daMaxLength.Fill(myDataSet, "MyInfo")
daMaxLength.FillSchema(myDataSet, SchemaType.Source, "MyInfo")

tmpML =
myDataSet.Tables("MyInfo").Columns("FirstName").Ma xLength.ToString
CR Junk

Sep 25 '06 #2

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

Similar topics

7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
3
by: kai | last post by:
Hi, All I try to trigger tab key press when enter a string in "customer ID" if its length is six, but I cannot find command to simulate TAB KEY press. PLease help. Thanks a lot Kai
11
by: Zlatko Matić | last post by:
Hello. I have a MS Access front-end working with PostgreSQL database. I have successfully created saved File DSN. My paa-through queries are referring to that file as well as linked tables. But I...
2
by: NewsAccount | last post by:
Hi I'm trying to find a way to programmatically measure the size of the page sent down to the browser, can't seem to measure the length of what gets written to the HTML TextWriter in protected...
6
by: Brian Roisentul | last post by:
Hi everyone, I've been investigating for a while about this, but with no luck yet. Does anybody know a way to do it? Many thanks, Brian
0
by: Peter Afonin | last post by:
Hello, I'm still learning Crystal reports, and now I need to sort report programmatically. I've found a good article about it:...
7
by: Nick | last post by:
Hi there, Is it possible to tell how a WebMethod was invoked? For example I would like to determin if it was invoked via SOAP or HTTP Post. Other than creating 2 methods I am no sure if I can...
2
by: David | last post by:
Hello, I would like to know how to post form data programmatically. The idea is to get the intranet web page, programmatically entre the username and password in a login form, post it and be...
3
by: Peter | last post by:
Hi I want to programmatically perform a post. Can some one please give me some pointers to which classes I need to use to achieve this? The form which is normally posted from the website looks...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
1
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.