Database Documentation - List of Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get a list of all my queries so that I can create training
documentation without having to retype all the query names...is there a way
to do this (other than screen print)? I have about 40 queries.
 
MSMichelle,

One way is to loop through the QueryDefs collection, and print them out to
the Immediate Window (accessed by Ctrl-G). Assign the following code to the
OnClick procedure of a temporary command button and press.

Dim db As Database
Dim qry As QueryDef
Set db = CurrentDb()

For Each qry In db.QueryDefs
Debug.Print qry.Name
Next qry
Set db = Nothing

Hope that helps.
Sprinks
 
In a query:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE MSysObjects.Name Not Like "~*"
AND MSysObjects.Type = 5
ORDER BY MSysObjects.Name;
 
you are my hero! thank you thank you

Jerry Whittle said:
In a query:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE MSysObjects.Name Not Like "~*"
AND MSysObjects.Type = 5
ORDER BY MSysObjects.Name;
 
Here's a list of some of the other types:
1 TABLE
5 QUERY
6 TABLE LINKED
8 RELATIONSHIPS
-32756 PAGE
-32761 MODULE
-32764 REPORT
-32766 MACRO
-32768 FORM
 
Jerry,

Thanks; this is a better way.

Sprinks

Jerry Whittle said:
Here's a list of some of the other types:
1 TABLE
5 QUERY
6 TABLE LINKED
8 RELATIONSHIPS
-32756 PAGE
-32761 MODULE
-32764 REPORT
-32766 MACRO
-32768 FORM
 
There is a built in database documenter..and you don't need to wite any
code.

Toos->analyse->documenter..

The above will printout all you need....
 
While that's true, Albert, the documeter includes much more information than
is often required. If a simple list is all that's required, the SQL Jerry
provided is quite handy.

Sprinks
 
Is there any way to modify Jerry's code to include the SQL of the query?

I'd be interested in this less for training purposes and more for
documentation purposes. (As to built in documentation tool: I think it's an
unwieldy piece of crap.)

Thanks,

Dave
 
sp_helpText 'myqueryname'

or if you're a baby and you still use MDB; you can use the .SQL method
of the querydef object
 

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