Getting a query's SQL statement

I

Ivan Debono

Hi all,

How is it possible to get the query's SQL statement using ADO??

Thanks,
Ivan
 
A

Allen Browne

ADOX lists the queries as Tables that are Views or Procedures, and you can
get the CommandText of the Command object.

Much easier to use:
dbEngine(0)(0).QueryDefs("MyQuery").SQL
 
I

Ivan Debono

Thanks for tip.

I went with ADOX because I'm doing it in VB. Had to check the Procedures
collection as the query was a UNION. Works great!!
 
Top