How do I print a list of database object names?

G

Guest

I want to print the list of database object (tables, queries, forms, reports,
etc.) names for my database. Anybody know how to do this easily?
 
J

Joseph Meehan

AlfUlz said:
I want to print the list of database object (tables, queries, forms,
reports, etc.) names for my database. Anybody know how to do this
easily?

The documenter function would do that and maybe a lot more than you
want. Look for it under the tools menu.
 
G

Guest

Use the MSysObjects table to list the objects and there names

e.g List of tables, using Type 1 in the criteria

SELECT MSysObjects.Name
FROM MSysObjects
WHERE InStr([Name],"~")=False
GROUP BY MSysObjects.Name, MSysObjects.Type
HAVING MSysObjects.Type=1
 
G

Guest

It's ugly and maybe not complete, but it works!

SELECT IIf([MSysObjects].[Type]=1, 'TABLE',
IIf([MSysObjects].[Type]=5, 'QUERY',
IIf([MSysObjects].[Type]=-32768, 'FORM',
IIf([MSysObjects].[Type]=-32764, 'REPORT',
IIf([MSysObjects].[Type]=-32766, 'MACRO',
IIf([MSysObjects].[Type]=-32761, 'MODULE',
IIf([MSysObjects].[Type]=-32756, 'PAGE',
IIf([MSysObjects].[Type]=8, 'RELATIONSHIPS',
IIf([MSysObjects].[Type]=6, 'TABLE LINKED',
'Unknown'))))))))) AS ObjectType,
MSysObjects.Name,
MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "~*"
and (MSysObjects.Name) Not Like "Msys*")
and ((MSysObjects.Type) Not In (2,
3)))
ORDER BY IIf([MSysObjects].[Type]=1, 'TABLE',
IIf([MSysObjects].[Type]=5, 'QUERY',
IIf([MSysObjects].[Type]=-32768, 'FORM',
IIf([MSysObjects].[Type]=-32764, 'REPORT',
IIf([MSysObjects].[Type]=-32766, 'MACRO',
IIf([MSysObjects].[Type]=-32761, 'MODULE',
IIf([MSysObjects].[Type]=-32756, 'PAGE',
IIf([MSysObjects].[Type]=8, 'RELATIONSHIPS',
IIf([MSysObjects].[Type]=6, 'TABLE LINKED',
'Unknown'))))))))),
MSysObjects.Name;
 

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