devSoft144
Programmer
I am importing data to Access 2002 from an Oracle database. My vba code is:
Sub importTbl()
DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=myDSN;UID=myUID;PWD=myPW", acTable, "SourceTbl", "DestTbl", False
' the above transfer is succesful.
' The next transfer produces an error
' Note that I need a different UID
DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=myDSN;UID=myUID2;PWD=myPW", acTable, "SourceTbl2", "DestTbl2", False
End Sub
The error is: 3011 cannot find object 'DestTbl2'
I can see the second transfer in the clipboard.
If I place the two transferDatabase commands in two different subs, run one sub, quit and restart Access then I can run the second transferDatabase. Evidently the ODBC connection from the first transfer is interfering with the ODBC connection for the second transfer. Is there a method to log-out/quit/close the first ODBC connection without quiting Access?
Thanks in advance for your help.
Sub importTbl()
DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=myDSN;UID=myUID;PWD=myPW", acTable, "SourceTbl", "DestTbl", False
' the above transfer is succesful.
' The next transfer produces an error
' Note that I need a different UID
DoCmd.TransferDatabase acImport, "ODBC", "ODBC;DSN=myDSN;UID=myUID2;PWD=myPW", acTable, "SourceTbl2", "DestTbl2", False
End Sub
The error is: 3011 cannot find object 'DestTbl2'
I can see the second transfer in the clipboard.
If I place the two transferDatabase commands in two different subs, run one sub, quit and restart Access then I can run the second transferDatabase. Evidently the ODBC connection from the first transfer is interfering with the ODBC connection for the second transfer. Is there a method to log-out/quit/close the first ODBC connection without quiting Access?
Thanks in advance for your help.