views:

136

answers:

3

Hi everyone,

I'm trying to connect to an oracle db from an odbc connection, the odbc connection is set and works properly when we test it. However when I try to connect to through ASP classic I keep getting that msg. I'm also able to connect to it through SQLPLUS and able to ping it with tnsping

<%
Dim connection : Set connection = Server.CreateObject("ADODB.Connection")
Dim connectionString : connectionString = "Provider=MSDAORA.1; Password=Test;User ID=Test; Data Source=DBSOURCE"
connection.Open connectionStringResponse.Write Err.Number
%>

this works on a co-worker machine but not mine.

Thanks for the help everyone.

+1  A: 

"this works on a co-worker machine but not mine."

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:

  • the TNANAMES.ORA file
  • the SQLNET.ORA file
  • the LISTENER.ORA file (if you're using a local database)
APC
Originally thats what I though too, however after copying the TNSNAMES.ora and SQLNET.ora from my co-worker (Whose connection works) it still doesn't solve the issue
MikeAbyss
The odd thing is there he is able to ping the database via tnsping. Creating an ODBC connection and testing it from the ODBC interface works fine. Connecting via sqlplus also works...
Mike
Could be there's some service that needs restarting to pick up a changed TNSNAMES.ORA or registry setting change). Maybe try bypassing TNSNAMES.ORA by directly specifying a host:port:service
Gary
A: 

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.

DCookie
Thanks for answering, however it didn't solve the problem :(
MikeAbyss
A: 

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.

sunil