Hello Accessers
I am looking for your advice on how to set an ADO connection object to use the very same ODBC - Oracle connection that Access 2000 opens for tables that are linked to an Oracle database.
Rather than opening a new connection - eg cnnOracle.Open etc, I would like to access the same connection used by the linked tables.
Can anyone suggest the VBA code to do this??
I'll be eternally greatful
Dan
----------------------
To explain what I mean, and why this is needed:
The database in question has an Access FE, Oracle BE. The FE contains ODBC linked tables pointing to the actual tables in Oracle.
Several of the Oracle tables are temporary tables, which means that they are created in Oracle each time a user connects, and they are unique to that connection. This means that two users logged on simultaneously could have different contents in these tables. I have done this at the request of the Oracle DBA, but it fits well with the program logic.
Using these tables through their linked table in the front-end works fine. But I also need to use a direct ADO connection to the Oracle back-end to run stored procedures.
But when an Oracle connection is created, such as:
it creates a separate connection to Oracle, and hence separate instances of the temporary tables which don't reflect any changes made via the linked tables visible in the front-end.
While it may be possible to find another workaround, all my problems would be solved if I could just set my ADO connection object cnOracle, to point to the same connection that Access makes in the background for the linked tables.
I am looking for your advice on how to set an ADO connection object to use the very same ODBC - Oracle connection that Access 2000 opens for tables that are linked to an Oracle database.
Rather than opening a new connection - eg cnnOracle.Open etc, I would like to access the same connection used by the linked tables.
Can anyone suggest the VBA code to do this??
I'll be eternally greatful
Dan
----------------------
To explain what I mean, and why this is needed:
The database in question has an Access FE, Oracle BE. The FE contains ODBC linked tables pointing to the actual tables in Oracle.
Several of the Oracle tables are temporary tables, which means that they are created in Oracle each time a user connects, and they are unique to that connection. This means that two users logged on simultaneously could have different contents in these tables. I have done this at the request of the Oracle DBA, but it fits well with the program logic.
Using these tables through their linked table in the front-end works fine. But I also need to use a direct ADO connection to the Oracle back-end to run stored procedures.
But when an Oracle connection is created, such as:
Set cnOracle = New Connection
strConnect = "Provider=MSDASQL;DSN=DAHD;UID=" & strUser & ";DBQ=DB_DEV;pwd=" & strPassword .....
cnOracle.ConnectionString = strConnect
cnOracle.Open
strConnect = "Provider=MSDASQL;DSN=DAHD;UID=" & strUser & ";DBQ=DB_DEV;pwd=" & strPassword .....
cnOracle.ConnectionString = strConnect
cnOracle.Open
it creates a separate connection to Oracle, and hence separate instances of the temporary tables which don't reflect any changes made via the linked tables visible in the front-end.
While it may be possible to find another workaround, all my problems would be solved if I could just set my ADO connection object cnOracle, to point to the same connection that Access makes in the background for the linked tables.