Hello everyone.
I have a front-end Access database connected via ODBC to a SQL Server 7 backend.
In Access, I have a simple pass-through query pointing to the first of over 2500 tables in SQL Server:
"SELECT * FROM table_1"
I have saved the pass-through query as "qryTable"
Without getting into the reasons why (they are fairly complicated and beyond the scope of this post), I need to find a way to change the SQL statement of qryTable from within VBA.
For example, changing the SQL Statement from "SELECT * FROM table_1" to "SELECT * FROM table_2". As I said, the reason behind the need is fairly complicated. I can't just simply create a separate query for each table.
So, if anyone knows how to change the SQL of a saved query from VBA, I'd love to hear about it.
If I cannot dynamically change the definition of a saved query from VBA, how about tips on creating a permanent pass-through query from VBA.
Many thanks!
-- Alan
I have a front-end Access database connected via ODBC to a SQL Server 7 backend.
In Access, I have a simple pass-through query pointing to the first of over 2500 tables in SQL Server:
"SELECT * FROM table_1"
I have saved the pass-through query as "qryTable"
Without getting into the reasons why (they are fairly complicated and beyond the scope of this post), I need to find a way to change the SQL statement of qryTable from within VBA.
For example, changing the SQL Statement from "SELECT * FROM table_1" to "SELECT * FROM table_2". As I said, the reason behind the need is fairly complicated. I can't just simply create a separate query for each table.
So, if anyone knows how to change the SQL of a saved query from VBA, I'd love to hear about it.
If I cannot dynamically change the definition of a saved query from VBA, how about tips on creating a permanent pass-through query from VBA.
Many thanks!
-- Alan