简体   繁体   中英

ORA-12154 error on server 2008

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM