473,808 Members | 2,745 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmaticall y Determin Max Field Length

I'm trying to programmaticall y 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 1513

crjunk wrote:
I'm trying to programmaticall y 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("S ELECT * FROM
MyInfo WHERE 1 = 0", objConn)
Dim daMaxLength As OleDbDataAdapte r = New OleDbDataAdapte r(cmd)
Dim myDataSet As DataSet
myDataSet = New DataSet
daMaxLength.Fil l(myDataSet, "MyInfo")
daMaxLength.Fil lSchema(myDataS et, SchemaType.Sour ce, "MyInfo")

tmpML =
myDataSet.Table s("MyInfo").Col umns("FirstName ").MaxLength.To String
CR Junk

Sep 25 '06 #2

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

Similar topics

7
6220
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 make it better soon. Unfortunately, there is never a non-crucial time in which we can do an upgrade, so we are stuck for now. Point 1: There are multiple tables: students, courses, cross-reference
3
16498
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
10291
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 don't understand what will happen when I distribute my front-end to some other PC. How will Access know where is File DSN ? Is there any way that I set the connection programmatically. For example, some login form with neccessary informations ?...
2
7080
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 override void Render(HtmlTextWriter writer) {
6
3947
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
1941
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: http://blogs.ittoolbox.com/c/coding/archives/sorting-the-fields-in-crystal-report-programmatically-16201. This is how it described there: ReportDocument objReport = new ReportDocument(); objReport.Load("Your report path"); FieldDefinition FieldDef;
7
1574
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 do this. Many thanks for your time. Nick.
2
2449
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 redirected to the logged in page. So far I have found the code to post data in a form, but I am not sure if this is the correct way to do it. Thank you in advance
3
2283
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 like the following, but I want to do it programmatically. <form action="https://intl.payments/recdpay" method="POST"
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10633
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
10376
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
10114
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
9198
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6880
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
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4331
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
3860
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.