0
votes

I'm moving a VB.NET 2010 app from a 32bit 2003 server to a 64bit 2008 server that connects to an Oracle 11g database, and am getting the following error message when executing it.

DefaultSource   Error   2
ERROR [08004] [Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

Here's some things I've done.

  • Added the TNS_ADMIN environment variable to the server.
  • Had server management install the 64bit "Oracle driver Oracle in OraClient11g_home1". They also uninstalled the 32bit "Microsoft ODBC for Oracle" driver.
  • Verified I can connect to the server using SQLPlus
  • Updated my connection string as I use to use the 32bit "Microsoft ODBC for Oracle"
  • Added the database to the ODBC System DNS, and verified the connection worked.

Here's my connection string from my config file under the node.

<add name="SCHEMA_NAME" 
 connectionString="Driver={Oracle in OraClient11g_home1};Dbq=DATABASE_NAME;uid=USER;pwd=PASSWORD;"/>

Any suggestions to what I can try, or what needs to be changed to get this working on the new server?

1
I want to add that TNSPING is working as well. - MikeL
Is your app compiled as "AnyCPU" or "x86"? Is it an IIS app? - GTG
It complies as AnyCPU, and it is executed by a batch script. WebSphere is running on the server, but it isn't connected to the app. - MikeL
I believe this part of the issue has been resolved. My server admin disabled the 32bit ODBC connector, but didn't uninstall it. Doing that remove the error, but added a new error message saying there's an "Arithmetic operation resulted in an overflow." The error confused me as the app only does string manuplation, and traced the error to running System.Data.Odbc.OdbcCommand.ExecuteReader(). - MikeL

1 Answers

0
votes

I fixed the problem by changing the way I connect to oracle. I'm using the Oracle.DataAccess reference, removing the driver reference in the connection string, and rebuilding the connection using OracleConnection and oracleCommand.