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?
 
Back
Top