Improve company productivity with a Business Account.Sign Up

x
?
Solved

"ORA - 12154 TNS: Could not resolve service name" using Microsoft's "system.data.oracleclient.dll" assembly

Posted on 2004-04-30
11
Medium Priority
?
11,684 Views
Last Modified: 2012-06-27
Hello,

I'm writting an applicatin in VB.NET that connects to an Oracle Database. I'm using Microsofts Orcale Client provider (system.data.OracleClient.dll). Everything is working fine on my computer (lol), but on a test computer, I am getting the error: "ORA - 12154 TNS: Could not resolve service name". I have a tnsnames.ora file and all other oracle applications are working fine. I also created an environment variable named TNS_ADMIN and pointed it to where the tnsnames.ora file is located. There are no errors within the tns file. Other oracle applications are using the tns file just fine and the tns names and definitions are valid (have been verified).

One point of note: on my machine, I have client software for oracle 9 but on the test computer it is 8.1

Both computers are using the DotNet framework 1.1
Both computers have system.data.oracleclient.dll
the TNS files are in different locations on both machines (theoretically, they could be anywhere)

It seems like microsofts provider cannot find the tnsnames.ora file. I'm not sure what to do to make sure it is finding the correct file.

I need help resolving this problem. Any assistance is much appreciated.

Thanks,
Tony
0
Comment
Question by:mytonytiger
  • 4
  • 2
  • 2
  • +3
11 Comments
 
LVL 21

Accepted Solution

by:
tovvenki earned 999 total points
ID: 10961738
Hi,
I think you need oracle client software to be installed in the test server also If you're using ASP.NET, you must also ensure that the appropriate "Web server users" (usually the user named ASPNET who runs the ASP.NET worker process) can access the client. Because ASPNET has only ordinary user privileges and not administrator privileges, you need to add ASPNET to the Access Control List. If the ASPNET user doesn't have access, you'll receive a message such as "Cannot load OCI.dll" or "ORA-12154 TNS: could not resolve service name."
have a look at this url
http://www.fawcette.com/vsm/2003_01/magazine/features/beauchemin/default_pf.aspx

hope that this helps you.

regards,
venki
0
 
LVL 5

Author Comment

by:mytonytiger
ID: 10961850
Oracle client software is on the test box, but I don't think it is necessary since I'm using Microsofts provider for Oracle. Also, I'm writing a windows application, not ASP, so I don't see the connection with setting up an ASPNET account. I'll take a look at the link though and see.

Thanks for the input. Also, I'm not saying your wrong, just that I don't think that is the solution.

0
 
LVL 5

Assisted Solution

by:tgannetts
tgannetts earned 501 total points
ID: 10966558
I think the tnsnames.ora files do have to be in the correct folder (the Network\Admin folder of the Oracle home directory)
To use local naming with Oracle 8.1, you need the tnsnames.ora to be in the C:\oracle\ora81\network\ADMIN\ directory.

BTW Can you connect to the database using SQLPlus on the test machine?

Tom
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 21

Assisted Solution

by:tovvenki
tovvenki earned 999 total points
ID: 10974688
Hi,
a. in the test machine are you able to connect to the oracle database using the oracle client.
I think the problem might be with the Net Service Name that you are using. So using the Oracle Client configure the net Service and make a connection with the Oracle Server by making a Service, using Oracle Net Configuration Assistant. Be sure to Test this service through the Assistant.
b. are you using the same sid in both the machines.

regards,
venki
0
 
LVL 5

Author Comment

by:mytonytiger
ID: 10990236
I cannot connect to the database at all.

The tnsnames.ora is in C:\oracle\ora81\network\ADMIN\

0
 
LVL 5

Author Comment

by:mytonytiger
ID: 11030645
In 8 days, no one has an answer?

The suggestions above do not answer my question. Things suggested (such as client software and tnsnames) were already in place before I asked, and others (such as web server users) do not apply.

After waiting over a week for an answer (first time ever for me on Experts-exchange I didn't get an answer that helped), I've given up

It's a shame too.

0
 
LVL 5

Expert Comment

by:tgannetts
ID: 11030719
I'm afraid that this problem does not appear to be a VB.Net problem - if you cannot connect to the database through SQL Plus then I suggest asking this question in one of the Oracle TAs.

Sorry couldn't be of any help....

Tom.
0
 
LVL 5

Author Comment

by:mytonytiger
ID: 11052738
Tom,

I never said I couldn't connect with SQL Plus.

When I said I couldn't connect to the database at all, I was referring to my application. I had misread tovvenki's question and answered according to what I thought he was asking. Since I had already stated in the first post "other oracle applications are working fine" I just figured it was clear. Sorry for the confusion. I didn't even catch my mistake until you just now pointed it out. But since there was no feedback, I missed it.

I really don't care if this is a .NET issue, an Oracle Issue, or what anymore. I just need it fixed and can't figure out why it won't work.

I guess I'll just rebuild and start over.
0
 

Expert Comment

by:sergey_qw
ID: 11158928
By the way what exactly version of 8.1 Oracle client on test machine?

.Net Microsoft oracle provider supports Oracle client software version 8.1.7 and later
0
 

Expert Comment

by:madhukartha
ID: 11368073
By any chance, did you manage to resolve this problem?
We are facing the same problem.When searched , we got a link to this posting.
0
 

Expert Comment

by:hparab
ID: 11815472
Did any find a solution to this? Again a windows app, and can connect with SQL plus. but get the error msg while trying from the app. TNSnames.ora is in the correct place also
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Watch the video to know the process of migration of Exchange or Office 365 mailboxes in absence of MS Outlook. It is an eminent tool which can easily migrate Public, Archive user mailboxes from one another Exchange server and Office 365. Kernel Migr…
Watch the software video of Kernel Import PST to Office 365 tools which can easily import PST and OST files to Office 365 for bulk mailboxes. The process of migration is simple and user can map source and destination mailboxes and easily import data…

585 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question