I am trying to create an ODBC connection in a VBA script to an Oracle database, and I get the following error:
Run-time error '-2147467259 (800004005)':
Specified driver could not be loaded due to system error 193: (Oracle in instantclient_11_2, C:\apps\oracle\11.2.0.3\instant-32\SQORA32.dll)
When going to
%systemdrive%\Windows\SysWoW64\odbcad32.exe
I can see my driver "instantclient_11_2" and the file "SQORA32.dll" and it works perfectly when connecting to the db in Python.When using regedit, in
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers
I can see the driver too.Here is my code, I tried two different connection strings:
-
strCon = "DRIVER={Oracle in instantclient_11_2};DBQ=MyDBQ;UID=MyID;PWD=MyPWD"
-
strCon = "Driver={Oracle in instantclient_11_2}; " & _ "CONNECTSTRING=(DESCRIPTION=" & _ "(ADDRESS=(PROTOCOL=TCP)" & _ "(HOST=MyServer)(PORT=MyPort))" & _ "(CONNECT_DATA=(SID=MySID))); uid=MyID;pwd=MyPWD;"
My MS Excel version is in 32 bits and so is my driver (SQORA32.dll) so I assume it doesn't have anything to do with a 322/64 versions problem, but I may be wrong.
Any help/advice/solution is welcome.