query to show table structures in database

MrTibbs

Registered User.
Local time
Today, 04:52
Joined
Oct 10, 2001
Messages
101
Access '97.
Is there a way of querying a given database and reporting basic details (fieldname, size, type, index mode) regarding the structure of the tables?
The Documenter can do it but gives too much information, isn't available except in the Developer edition AFAIK, and doesn't lend itself to easy export.
 
If you can't find any other way to do this, look at the code in the Help Files that talks about the TableDefs collection.

Basically, the database contains a TableDefs collection. Each element of the collection is a TableDef (no "s"). The TableDef is itself a collection of field definitions, FieldDefs, plus its other properties. Each FieldDef includes field name, size, format, etc.

There is also a QueryDefs collection with FieldDefs in it analogous to TableDefs.

Finally, there is a Relations table that lists the defined relationships between fields in separate tables.

If you create a recordset and use some simple VBA looping code to visit each definition you want, you can get exactly what you wanted.
 

Users who are viewing this thread

Back
Top Bottom