By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,505 Members | 1,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,505 IT Pros & Developers. It's quick & easy.

How do I print the definitions of several queries

P: n/a
Hi there,

I have a database with what seems like a trillion (ok, 50) interlinked
queries.

I want to print out, from a code subroutine, the SQL query definitions.

Is this even possible? I've looked and looked and am not getting
anywhere.

Rob.

Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
This won't format very well, but it demonstrates what you asked for:

Public Function ShowAllQueries()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef

Set db = CurrentDb()
For Each qdf In db.QueryDefs
Debug.Print qdf.Name, qdf.SQL
Next
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"dkintheuk" <rm*******@firenet.uk.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...

I have a database with what seems like a trillion (ok, 50) interlinked
queries.

I want to print out, from a code subroutine, the SQL query definitions.

Is this even possible? I've looked and looked and am not getting
anywhere.

Rob.

Nov 13 '05 #2

P: n/a
Yet again i am extremely grateful for the help i get on this board. I
can handle formatting and this is yet another of those ones i should
have sussed out for myself.

Many thanks,

Rob.

Nov 13 '05 #3

P: n/a
jv
If you don't need it to be ran from a code subroutine then it is
simpler to use the Documenter tool from the tools menu (Tools - Analyze
- Documenter). This tool will give you the option to print the SQL,
query properties, parameters, relationships, indexes, and fields
properties for all or selected objects.

Nov 13 '05 #4

P: n/a
One of the reports that my CSD Tools add-in creates will do
exactly this. It will print out the SQL of each query and will
save several trees over the built-in Documentor.

You can find the add-in here on my site:

http://home.bendbroadband.com/conrad.../csdtools.html

Yes, it is free, but you must agree to my terms.
;-)

--
Jeff Conrad
Access Junkie
http://home.bendbroadband.com/conrad...essjunkie.html
http://www.access.qbuilt.com/html/articles.html

"dkintheuk" wrote in message:
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi there,

I have a database with what seems like a trillion (ok, 50) interlinked
queries.

I want to print out, from a code subroutine, the SQL query definitions.

Is this even possible? I've looked and looked and am not getting
anywhere.


----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 13 '05 #5

P: n/a
On 27 Jun 2005 12:14:54 -0700, "jv" <ju***********@hotmail.comwrote:
>If you don't need it to be ran from a code subroutine then it is
simpler to use the Documenter tool from the tools menu (Tools - Analyze
- Documenter). This tool will give you the option to print the SQL,
query properties, parameters, relationships, indexes, and fields
properties for all or selected objects.
My experience has been that Documenter wastes a lot of paper.
Aug 31 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.