I'm trying to connect to an oracle db from an ASP classic application, however I keep running into the ORA-12154 error.
TNSNAMES.ORA is configured properly
DBSOURCE.A.B.com = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = C.D.B.com)(PORT = 1231)) ) (CONNECT_DATA = (SERVICE_NAME = DBSOURCE) ) )
I can TNSPING
C:\Documents and Settings\USERID.A>tnsping DBSOURCE
TNS Ping Utility for 32-bit Windows: Version 10.2.0.4.0 - Production on 09-MAR-2 011 09:12:31
Copyright (c) 1997, 2007, Oracle. All rights reserved.
Used parameter files: C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\sqlnet.ora
Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = C.D.B.com)(PORT = 1231))) (CONNECT_DATA = (SERVIC E_NAME = DBSOURCE))) OK (30 msec)
I can create an ODBC connection and I've tested the connection which is successful.
- I can connect to the oracle db through toad.
I've checked my sqlnet.ora file
NAMES.DEFAULT_DOMAIN = A.B.com
SQLNET.AUTHENTICATION_SERVICES= (NONE)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
I've also checked that the TNSNAMES.ORA as one of my system paths.
I can connect to the DB with SQLPLUS
Here is the code that throws the error
dim CnnStr
Set Cnn = Server.CreateObject("ADODB.Connection")
CnnStr="Provider=MSDAORA.1;Password=pass;User ID=user;Data Source=DBSOURCE"
Cnn.Open CnnStr
I am running windows XP Pro 32bit SP3
I've tested this on a co-workers machine and the asp app has no issues, am I missing a configuration somewhere or did I mess up my config?
Thanks for the help everyone!
ORA-12154 is usually a configuration issue, and it would certainly seem to be so in your case. The short answer is to compare your machine with your colleague's one and figure out what the difference is.
Things to check include:
If you are running a 64-bit OS and oracle 10 try installing all the patches for oracle. Something similar happened to me, SQL plus and all else worked, except my .NET program. I was running a .Net program out of the "Program files (x86)" folder. Installing patches fixed it.
It seems all the settings have been checked but here is my suggestions for some trouble shooting:
(What did you finally do to solve it?)
I had the similar problem and found a simple solution. You don't have to modify any config files. Hope this can help you:
The solution is from here:http://oraclequirks.blogspot.com/2008/11/ora-12154-tnscould-not-resolve-service.html
Try setting the value of the environment variable TNS_ADMIN on the machine with the problem to /network/admin (or wherever your tnsnames.ora file lives) and see if that helps.
The likely problem is the lack of read permission upon the Oracle directories by the User IIS is running-as.
As @Derick says, temporarily set the permissions wide-open on the $ORACLE_HOME directory (Everyone = Full Control), restart IIS, and test. When that works, give the IIS User read permission against that directory.
You can also confirm this issue using Process Monitor from Microsoft SysInternals, and seeing the failure message during the CreateFile(...) API call to open the DLLs or read the TNSNAMES.ORA file. Given the way temporary files work when selecting through cursors, you may also need to give the IIS user write permissions into some directories.