How do I print a list of database object names?

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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.
 
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
 
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;
 
Back
Top