473,799 Members | 2,929 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 1511

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
16496
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
10289
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
7079
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
3945
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
1573
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
2448
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
9538
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10473
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
10249
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
10025
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...
1
7563
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6804
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
5461
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...
2
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2937
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.