Can't connect twice to linked table using ACE/JET driver
- by Tmdean
I'm trying to connect to an MS Access database linked table in VBScript. It works fine connecting the first time on one connection but if I close that connection and open a new one in the same script it gives me an error.
test.vbs(13, 1) Microsoft Office Access Database Engine:
ODBC--connection to '{Oracle in OraClient10g_home1}DB_NAME' failed.
This is some code that triggers the error. TABLE_1 is an ODBC linked table in the test.mdb file.
Dim cnn, rs
Set cnn = CreateObject("ADODB.Connection")
cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data source=test.mdb"
Set rs = cnn.Execute("SELECT * FROM [TABLE_1]")
rs.Close
cnn.Close
Set cnn = CreateObject("ADODB.Connection")
cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data source=test.mdb"
Set rs = cnn.Execute("SELECT * FROM [TABLE_1]") '' crashes here
rs.Close
cnn.Close
This error does not occur if I try to access an ordinary Access table. Right now I'm thinking it's a bug in the Oracle ODBC driver.