Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query to list all tables in database?? 1

Status
Not open for further replies.

numbered

Technical User
Jun 10, 2002
54
CA
Is there an sql query to list all tables in an ms access database?
 
I've not seen it done in a SQL query - but you can certainly do it in VBCode

A table is an object in the tables collection of the Database ( Or Connnection ) object
( Depending on whether you're using DAO or ADO )

So simply enumerate through the collection and print to a txtControl on a form - or whereever you need it to go.



'ope-that-'elps.

G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Thanks LittleSmudge but, I found the answer to my own question.

SELECT msysobjects.name
FROM MSysObjects
 
Well done numbered

So why didn't I think of that one !


Have a (humbly given) star from me for that.


:) G LS
accessaceNOJUNK@valleyalley.co.uk
Remove the NOJUNK to use.

Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need! :-D

 
Look at this thread
thread702-383980 Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need!
 
Code:
SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "MSys*") AND ((MSysObjects.Type)=1))
WITH OWNERACCESS OPTION;
[/code

And ADD the Conditionals!  Your attempt lists ALL objects, nit just the tables, AND, it includes the system tables which are not generally considered to be part of the db.

 MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top