0

I am able to connect to oracle db using ODBC data source administrator using below method and connection is succesful.

enter image description here enter image description here

But if I try to connect using Excel vba using below connection string. I am getting error.

   strConnection1 = "DRIVER={Oracle in OraClient12Home1_32bit};DBQ=dw-server.int:1521/pdw1s_default;UID=user;PWD=pass"
   adoConnection.Open strConnection1

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I tried different combinations for Driver like `Microsoft ODBC for Oracle'. But still same error. PATH is set Oracle client in environment variables. I don't know what I am missing. Please help

Arvinth
  • 60
  • 6
  • 27
  • 1
    Which folder is defined in PATH? According to your screenshot you have (at least) two Oracle Clients installed. They may clash with each other. – Wernfried Domscheit Aug 04 '19 at 09:41
  • 1
    Is your Excel 64-bit or 32-bit? – Wernfried Domscheit Aug 04 '19 at 15:01
  • Excel is 64-bit and path is set correctly for `Oracle in OraClient12Home1_32bit.` C:\app\client\ze087788\product\12.2.0\client_1\bin – Arvinth Aug 04 '19 at 15:35
  • 1
    @RobertBaron, it is the opposite, `C:\Windows\sysWOW64\odbcad32.exe` launches the **32-bit** ODBC Administrator. – Wernfried Domscheit Aug 04 '19 at 20:25
  • 1
    When your Excel is 64-bit then you have to install the 64-bit Oracle Client/ODBC driver. Apparently you have the 32-bit version installed. In case you like to install both 32-bit and 64-bit, follow this instruction: https://stackoverflow.com/questions/24104210/badimageformatexception-this-will-occur-when-running-in-64-bit-mode-with-the-32#24120100 – Wernfried Domscheit Aug 04 '19 at 20:27
  • Thanks a lot for the details! I will follow the instruction specified. – Arvinth Aug 05 '19 at 03:11

0 Answers0