I am developing a form that allows a user to chose a Server & Database & enter their credentials.
The form has several buttons that execute SQL Pass Through queries against a Sybase database.
The first pass works fine: the user choses Server1 and Db1, provides credentials, and executes the pass-thrus. Life is good.
But, if they then chose Server2 and Db2, enter new credentials, and reexecute the pass-thrus, they are still executed against Server1 and Db1. You must close / reopen Access to chose a different back end database.
In a nutshell, Access seems to remember (get stuck?) on the first Server/DB connection I make. I verify that myQuery.Connect has been correctly changed to the new Server / Db combination,
I've set up test code to simply loop through a bunch of hard coded connect strings, execute a "select db_name()" sql pass through and MsgBox the connect string / query results. The connect string changes as expected, but I get the first db_name() every time.
Is there any way to avoid this close / re-open work around?
Many thanks.
The form has several buttons that execute SQL Pass Through queries against a Sybase database.
The first pass works fine: the user choses Server1 and Db1, provides credentials, and executes the pass-thrus. Life is good.
But, if they then chose Server2 and Db2, enter new credentials, and reexecute the pass-thrus, they are still executed against Server1 and Db1. You must close / reopen Access to chose a different back end database.
In a nutshell, Access seems to remember (get stuck?) on the first Server/DB connection I make. I verify that myQuery.Connect has been correctly changed to the new Server / Db combination,
I've set up test code to simply loop through a bunch of hard coded connect strings, execute a "select db_name()" sql pass through and MsgBox the connect string / query results. The connect string changes as expected, but I get the first db_name() every time.
Is there any way to avoid this close / re-open work around?
Many thanks.