473,666 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting the data types and sizes from Access

1 New Member
I would like to write an SQL query that would bring back a list of all the tables, fields, data types and sizes in Access. I can do this in SQL server but cannot find the field information in the hidden tables.

Any ideas would be appreciated.

Kind regards

PeterF
Oct 15 '06 #1
1 1257
MMcCarthy
14,534 Recognized Expert Moderator MVP
If you just need the information you can retrieve it using the documenter.

Tools - Analyse - Documenter

Highlight the tables you want and the documenter will create a report showing this information. Make sure you change the options.

If you need an actual table you will need to use a function similar to the one below:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Function TableStructure(tblName As String)
  3. Dim db as Database
  4. Dim rs as Recordset
  5. Dim i as Integer
  6.  
  7.     Set db = CurrentDb
  8.     Set rs = db.OpenRecordset("TableToStoreValues")
  9.  
  10.     For i = 0 To db.tabledefs(tblName).Fields.Count - 1
  11.         rs.AddNew
  12.         rs!TableName = tblName
  13.         rs!FieldName = db.tabledefs(tblName).Fields(i).Properties(4).Value
  14.         rs!FieldSize = db.tabledefs(tblName).Fields(i).Properties(3).Value
  15.     Next i
  16. End Sub
  17.  
  18.  
I would like to write an SQL query that would bring back a list of all the tables, fields, data types and sizes in Access. I can do this in SQL server but cannot find the field information in the hidden tables.

Any ideas would be appreciated.

Kind regards

PeterF
Oct 15 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

80
5242
by: Bibby | last post by:
Hi, I'm interested in getting started in the programming world. I've dabbled in C, C++ and VB6. Which would be the best language to focus my attention to regarding the following considerations: Hireability Portability Flexibility The likely candidates seem to be Java, VB.Net, C, C++, C#.
8
1797
by: Kyle Kolander | last post by:
Sorry, I sent this to comp.std.c++ and meant to send it here as well... Why are the minimum size guarantees for fundamental types intentionally omitted from section 3.9.1 Fundamental types of the C++ standard? If indeed these guarantees can be inferred from other parts of the standard, and it is the intent of the standards committee that these guarantees exist, then why are they not listed in the most relevant section? I've been...
6
22515
by: Martin | last post by:
I'd like to be able to get the name of an object instance from within a call to a method of that same object. Is this at all possible? The example below works by passing in the name of the object instance (in this case 'myDog'). Of course it would be better if I could somehow know from within write() that the name of the object instance was 'myDog' without having to pass it as a parameter. //////////////////////////////// function...
26
12007
by: Kip | last post by:
Greetings everyone, Is there anyone here who could point me to a page or pdf that has a list of the sizes of all of the C primitive data types on various implementations such as SPARC, x86, PowerPC, etc? Thank you. -- Kip Warner
12
3431
by: siliconwafer | last post by:
Who decides size of data types in C? Is it the: 1.C standard and hence the compilers 2.Operating System.
33
11842
by: JamesB | last post by:
I am writing a service that monitors when a particular app is started. Works, but I need to get the user who is currently logged in, and of course Environment.UserName returns the service logon (NT_AUTHORITY\SYSTEM). I understand that when the service starts, no user may be logged in, but that's ok, as the app I am monitoring can only be run by a logged in user. Do I need to use WMI to get the user context of Explorer.exe or is there a...
159
6230
by: Bob Timpkinson | last post by:
Hi, I have a 32-bit machine... Is there anyway I can get gcc to use the following integer sizes? char: 8 bits short: 16 bits int: 32 bits long: 64 bits long long: 128 bits
3
2382
by: sophia.agnes | last post by:
Dear all, what are the major expression types in c? i have seen the following types of expressions 1) constant expressions 2) integral expressions 3) float expressions 4) pointer expressions
4
1666
by: jehugaleahsa | last post by:
Hello: Say I were to query the schema tables from a database management system. Say I got a DataType field that held the string 'VARCHAR2'. Now, I know that VARCHAR2 associates to System.String. However, different DBMSs have different types and worse, even some with the same type turn out to be different .NET types. I would like DMBS-independent way of getting a .NET type from a DataType string. Now, I have existing code that gets the...
0
8356
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
8871
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
8640
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
7387
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
5666
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
4198
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
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2773
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
2011
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.