[AccessD] A2K: Is is possible to get the SQL of a query through VBA

Darren DICK d.dick at uws.edu.au
Sun Aug 1 22:23:17 CDT 2004


Hello all
Say I have a query called sel_qry_AllOrders. It simply shows all order details
The SQL for sel_qry_AllOrders is..."SELECT tblOrders.* FROM tblOrders;"

Is it possible for me to get the query object and 'read' its SQL syntax eg

pseudo code

Dim MyQuery as query

query = "sel_qry_AllOrders"

debug.print "All orders query as SQL = " & SomethingCoolHereThatGetsTheSQLComponentOfTheQuery

and have the debug result say

All orders query as SQL = SELECT tblOrders.* FROM tblOrders;

Many thanks

Darren




More information about the AccessD mailing list