0

I'm trying to set up the Oracle instant client ODBC driver on Windows 10 because we're moving applications from Windows 7 / 32 bit to Windows 10 / 64 bit. The Windows 7 platform works using the Microsoft ODBC Driver for Oracle but that driver is deprecated. So I'm trying to install the 64 bit Oracle instant client. When trying to connect, I'm getting a TNS adapter protocol error. Every search that I've done leads me to solutions around checking the server but the server is working fine in the enterprise. I don't have an actual Oracle client installed, just the ODBC driver. Using the following connection string

Driver={Oracle in instantclient_11_2};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL = TCP)(HOST = redacted)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED)(SID=redacted))); Uid=redacted;Pwd=redacted;
Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110

2 Answers2

0

Which client application do you use?

If this is a 32-bit application (which seems to be the case because before you used the Microsoft ODBC Driver which exist only for 32-bit) then the ODBC driver must be also 32-bit! You cannot mix the architectures.

Of course you can install 32-bit applications/drivers on a 64-bit Windows.

The ODBC driver requires and Oracle client, however it looks like you installed it already.

Remove the space character from the connection string.

If you need to install both, the 32-bit and the 64-bit ODBC driver, follow this instruction: BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • The applications have been recompiled by the software vendor on 64 bit architecture, thus the reason we have to move to a 64 bit ODBC driver. –  Mar 18 '21 at 20:30
0

I solved the issue.

I created an ODBC data source for the connections I want to use and altered the connection strings to

dsn=redacted;uid=redacted;pwd=redacted

Also installed tnsnames.ora in c:\oracle\instantclient_19_10\network\admin\ directory and set TNS_ADMIN system environment variable to c:\oracle\instantclient_19_10

  • 1
    For the sake of completeness have a look at [Connection Strings](http://www.carlprothman.net/Default.aspx?tabid=90#ODBCDriverForOracleFromMicrosoft). The Microsoft ODBC driver uses `SERVER=xyz` whereas the Oracle ODBC driver uses `DBQ=xyz` Perhaps this was the root cause of your problem. – Wernfried Domscheit Mar 18 '21 at 21:41
  • Thanks. I'm not using the Oracle ODBC drive that page specifies though. There is an Oracle instant client package available at https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html –  Mar 19 '21 at 10:45