ORA-12154: TNS:could not resolve service name

B

Bruno Otero

Hi,

My connection string in my web application to my oracle database is
working fine when i test it on my machine.. But when i try to run the
application on the web server the error ORA-12154: TNS:could not
resolve service name appears.

Here it is the connection string:
string ConnectionString = @"Provider=msdaora;Data Source=GEST;User
ID=IND;Password=****";

Another thing.. On the web server i can connect with SQLPlus using this
database instance without any problem. It works fine. This error
appears only in the site.

Can anybody help me?
 
O

Ollie Riches

Off the top of my head it is failing to find the tnsnames.ora file that
contains the information required to connect to the oracle database. How is
the OleDb connection object meant to find the tnsnames.ora file?

I suggest you download the native driver supplied by Oracle:

http://www.oracle.com/technology/software/tech/windows/odpnet/index.html

There is an intersting article below, it isn't directly related to your
problem but it shows an alternative way to specify the database ytou wish to
connect to, don't know if this will work with OleDb though.

http://codebetter.com/blogs/sahil.malik/archive/2005/06/07/64254.aspx

Also interesting experiences here:

http://www.mcse.ms/archive27-2004-1-247123.html

HTH

Ollie Riches
 
C

Carlos J. Quintero [VB MVP]

Some suggestions:

- Logon locally on the server, create a file with extension .udl (OLEDB Data
Link file), open it, select your provider, fill your connection parameters
and click the button "Test Connection". If it succeeds, the problem is your
wep app (a credentials problem, etc.). If it fails, it is something in your
Oracle installation.

- Ensure that you have a TNSNAMES.ORA (or whatever name resolution method)
properly configured.

- Ensure that your C:\Oracle\OraXX\Bin folder in in the PATH variable of
MS-DOS. SQL*Plus does not require this, but everyone else does.

Let us know.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
B

Bruno Otero

Hello every one.. thanks for your attention and help.

The problem has been solved, the problem was on my configuration on
sqlnet.ora
As soon as i've changed it my web site started to connect to my
database.

Thanks again

Bruno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top