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!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top