I have an Access 2002 application which links an Oracle table via ODBC with this code:
Set HRSWsp = CreateWorkspace('CONNODBC', '', '', dbUseODBC) Set HRSConn = HRSWsp.OpenConnection('HRSCONN', dbDriverPrompt, , 'ODBC;') DoCmd.TransferDatabase acLink, 'Database ODBC', HRSConn.Connect, acTable, 'SCHEMA.TABLE', 'TABLE', False, True
Unfortunately, Access 2007 doesn’t accept this syntax anymore, saying that ODBCDirect is no more supported (Runtime error 3847) and suggesting to use ADO instead of DAO. Could someone please tell me how can I modify this code to satisfy Access 2007?
I found that I could solve my problem in a very simple way, by deleting the first two statements and modifying the third this way:
This way the table would be linked without prompting for anything. If I leave the connect string a simple ‘ODBC’, instead, Access will ask to specify the odbc connection and the other missing parameters, thus obtaining the same thing I tried to perform with the previous statements.