Query to obtain Schema and other info about the DB tables

J

JohnS

Is there a way to query Access (from within Access) to get a list of the
tables and queries in the DB?

I am trying to document a DB and would like to list out the table names and
get counts of tables without counting them by hand and retyping the names by
hand.

TIA
 
D

Douglas J. Steele

The following query will give you the tables:

SELECT [Name]
FROM MSysObjects
WHERE Name Not Like "MSys*"
AND [Type] In (1,4,6)
ORDER BY [Name]

(type 1 means tables in the same database, type 4 means tables linked using
ODBC, type 6 means other linked tables).

The following query will give you the queries:

SELECT [Name]
FROM MSysObjects
WHERE [Type] =5
ORDER BY [Name]

To avoid reinventing the wheel, you might check what Jeff Conrad has at
http://www.accessmvp.com/JConrad/accessjunkie/doctable.html
 
J

JohnS

Thanks.
Exactly what I was looking for.



Douglas J. Steele said:
The following query will give you the tables:

SELECT [Name]
FROM MSysObjects
WHERE Name Not Like "MSys*"
AND [Type] In (1,4,6)
ORDER BY [Name]

(type 1 means tables in the same database, type 4 means tables linked using
ODBC, type 6 means other linked tables).

The following query will give you the queries:

SELECT [Name]
FROM MSysObjects
WHERE [Type] =5
ORDER BY [Name]

To avoid reinventing the wheel, you might check what Jeff Conrad has at
http://www.accessmvp.com/JConrad/accessjunkie/doctable.html

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


JohnS said:
Is there a way to query Access (from within Access) to get a list of the
tables and queries in the DB?

I am trying to document a DB and would like to list out the table names
and
get counts of tables without counting them by hand and retyping the names
by
hand.

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top