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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get a list of my tables' names

Status
Not open for further replies.

OhioSteve

MIS
Mar 12, 2002
1,352
US
I discovered something today that may interest you. You can write an sql statement that will retrieve all of your tables' names:

SELECT
Name
FROM MSysObjects
WHERE (Type=1) AND (Flags=0)
ORDER BY Name;

You may not be familiar with MSysObjects. Every Access database has several system tables. To view them, go to tools/options/view tab and check "system objects". MSysObjects has an entry for each object in the .mdb.
 
See also:
thread700-1297490
thread700-1266009
thread700-1244914
etc.
 
How are ya OhioSteve . . .

MSysObjects is well known (at least by now). Here's a fuller listing of what you can get:

[tt][blue]Object: -Type
*************
Form: -32768
Report: -32764
Macro: -32766
Module: -32761
[purple]Local table: 1[/purple]
Local database: 2
Collection (e.g. forms, reports, modules, etc): 3
Query: 5
[purple]Linked table: 6[/purple]
Relationship: 8[/blue][/tt]

So actually . . .
Code:
[blue]Where [Type] In (1,6)[/blue]
. . . includes linked tables as well.

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Hi, TheAceMan1.
For completeness:
WHERE Type In (1,4,6)
 
Howdy [blue]PHV[/blue] . . .

Ya got me again! [thumbsup2]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top