Getting a query's SQL statement

  • Thread starter Thread starter Ivan Debono
  • Start date Start date
I

Ivan Debono

Hi all,

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

Thanks,
Ivan
 
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
 
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!!
 
Back
Top