Create a query of table names in a mdb

  • Thread starter Thread starter Jim Pockmire
  • Start date Start date
J

Jim Pockmire

What is the easiest way to do this? Can I use MSysObjects or do I need VBA
code on TableDefs or something else?
 
SELECT MsysObjects.Name FROM MsysObjects
WHERE (([Type] = 1) AND ([Name] Not Like "~*") AND ([Name] Not Like
"MSys*"))
ORDER BY MsysObjects.Name;

Include type 6 if you want linked tables as well, and type 4 for ODBC linked
table
 
Out of curiosity, why are macros, forms, reports and modules a minus sign
followed by a 5 digit number, rather than a simple integer like the tables?

Allen Browne said:
SELECT MsysObjects.Name FROM MsysObjects
WHERE (([Type] = 1) AND ([Name] Not Like "~*") AND ([Name] Not Like
"MSys*"))
ORDER BY MsysObjects.Name;

Include type 6 if you want linked tables as well, and type 4 for ODBC
linked table

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jim Pockmire said:
What is the easiest way to do this? Can I use MSysObjects or do I need
VBA code on TableDefs or something else?
 
Access is written in C, and presumably these are unsigned rather than
negative numbers as we see them in Access.

The choice of values makes more sense in hexadecimal also.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Jim Pockmire said:
Out of curiosity, why are macros, forms, reports and modules a minus sign
followed by a 5 digit number, rather than a simple integer like the
tables?

Allen Browne said:
SELECT MsysObjects.Name FROM MsysObjects
WHERE (([Type] = 1) AND ([Name] Not Like "~*") AND ([Name] Not Like
"MSys*"))
ORDER BY MsysObjects.Name;

Include type 6 if you want linked tables as well, and type 4 for ODBC
linked table


Jim Pockmire said:
What is the easiest way to do this? Can I use MSysObjects or do I need
VBA code on TableDefs or something else?
 

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

Back
Top