0

I have a VBA project that connects to a Oracle DB and runs some SQL queries. Now, the code is working smooth in Windows 7 machines, but not in Windows 10. My connection string is as below:

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sConnString As String

sConnString = "Driver={Microsoft ODBC for Oracle}; " & _
              "CONNECTSTRING=(DESCRIPTION=" & _
              "(ADDRESS=(PROTOCOL=TCP)" & _
              "(HOST=" & "localhost" & ")(PORT=" & "19005" & "))" & _
              "(CONNECT_DATA=(SERVICE_NAME=" & "XXXXXXXX" & "))); uid=" & username & " ;pwd=" & pwd & ";"


Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
conn.Open sConnString

I have attached the screenshot of the error message that I received while running it in Winidows 10 using Excel 2016.

Windows 10 Screenshot - Excel 2016

The code was written in Excel 2013 in the Windows 7 machine. Any solution for this?

ashleedawg
  • 20,365
  • 9
  • 72
  • 105
Vishnu Nath
  • 15
  • 2
  • 6
  • are both (Excel 2013 AND Excel 2016) 32bit versions? Possible Duplicate of: [Microsoft ODBC Driver Manager Data source name not found and no default driver specified](https://stackoverflow.com/questions/17115632/microsoftodbc-driver-manager-data-source-name-not-found-and-no-default-drive) – Pᴇʜ Mar 13 '18 at 12:30
  • 1
    @Pᴇʜ machine in which it was created has 32-bit Excel 2013. The Windows 10 machine that is displaying the error message is running on 64-bit Excel 2016. – Vishnu Nath Mar 13 '18 at 14:36
  • Then that's probably the issue. Have a look at that link I gave you in the first comment. I think that should explain it. If you have a 64-bit application the odbc driver needs also to be a 64-bit driver. – Pᴇʜ Mar 13 '18 at 14:38

0 Answers0