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

How to list SQL text of queries?

Status
Not open for further replies.

aludden

Programmer
Jan 24, 2002
2
US
Hello!

I want to list the sql of all my queries in a database, like the documenter does, except I don't like the way documenter does it.

Is there an object property I can list/iterate through?

Thanks!
alex
 
Never mind - I figured it out. Here's my code:

Dim obj As AccessObject, dbs As Object

Open "Capitation_Queries.txt" For Output As #1

Set dbs = Application.CurrentData

For Each obj In dbs.AllQueries
Print #1, "Query: " & obj.Name & ":"
Print #1, CurrentDb.QueryDefs(obj.Name).SQL
Print #1,
Print #1,
Next obj

Thanks!
alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top