P
Paul Hammond
We have 10 or more Oracle db all structured the same way. I want to be able
to switch between them based on the value in a combo box. I've already set
up the ODBC connections. Here's the code I am using.
strDB = Me.cboPub.Column(2)
strConnect = "ODBC;DSN=" & strDB &
";UID=MyUID;PWD=MyPassword;LANGUAGE=us_english;" _
& "SERVER=" & strDB
DoCmd.DeleteObject acTable, "ADDR_VW_ADDRESS"
DoCmd.TransferDatabase acLink, "ODBC Database", strConnect, acTable,
"ADDR.VW_ADDRESS", "ADDR_VW_ADDRESS"
This repeats for several more tables.
This fails until I manually connect to each database once. After that I
can switch between all the databases using this code.
How do avoid this manual process. Am I missing something in my connection
string?
The code
to switch between them based on the value in a combo box. I've already set
up the ODBC connections. Here's the code I am using.
strDB = Me.cboPub.Column(2)
strConnect = "ODBC;DSN=" & strDB &
";UID=MyUID;PWD=MyPassword;LANGUAGE=us_english;" _
& "SERVER=" & strDB
DoCmd.DeleteObject acTable, "ADDR_VW_ADDRESS"
DoCmd.TransferDatabase acLink, "ODBC Database", strConnect, acTable,
"ADDR.VW_ADDRESS", "ADDR_VW_ADDRESS"
This repeats for several more tables.
This fails until I manually connect to each database once. After that I
can switch between all the databases using this code.
How do avoid this manual process. Am I missing something in my connection
string?
The code