SBendBuckeye
Programmer
In DAO, I can retrieve the SQL property of a QueryDef object to find out the SQL code behind the query. I would do something like this:
strSQL = CurrentDB.QueryDefs("QueryName".SQL
How do I do that using ADO?
I have function that executes a Select query based on a parameter in one of 3 ways as below:
1. Parm string contains "Select " - Execute code directly
2. Parm is only one word - Check to see if it is a table name - If it is, SQL string = "Select * From " & parm - I can do this by checking if the name is in the AllTables collection
3. If neither case 1 nor 2 above then must be a query - I can verify that against AllQueries collection but cannot find where in ADO the query SQL string is stored.
Any ideas or suggestions are welcome! Have a great day!
strSQL = CurrentDB.QueryDefs("QueryName".SQL
How do I do that using ADO?
I have function that executes a Select query based on a parameter in one of 3 ways as below:
1. Parm string contains "Select " - Execute code directly
2. Parm is only one word - Check to see if it is a table name - If it is, SQL string = "Select * From " & parm - I can do this by checking if the name is in the AllTables collection
3. If neither case 1 nor 2 above then must be a query - I can verify that against AllQueries collection but cannot find where in ADO the query SQL string is stored.
Any ideas or suggestions are welcome! Have a great day!