Solved

[Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve service name

Posted on 2004-04-22
1
4,982 Views
Last Modified: 2012-08-13
Hi I'm trying to connect to an oracle database using VBA code in EXCEL and it comes up with this error when I try to run the macro

[Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve service name

I think the setting might be wrong also just in case this helps
Set cnOra = New ADODB.Connection
Set rsOra = New ADODB.Recordset

db_name = "test2"<-the actual name of the database is wxdb
UserName = "wworkstn"
Password = "change"

'Making an ODBC connection according to ADO
cnOra.Open "DSN=" + db_name + ";UID=" + UserName + ";PWD=" _
& Password + ";"
rsOra.CursorLocation = adUseServer

'Running a query
rsOra.Open "select global_name from global_name", cnOra, adOpenForwardOnly

so what settings do I need to use in the microsoft ODBC Data Source Administrator for either the user DSN or System DSN
0
Comment
Question by:amanda333
1 Comment
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 125 total points
ID: 10890764
Go to a command prompt and issue: tnsping test2

tnsping is a Oracle utility that verifies connectivity from the Oracle client to the listener on the server.  If you still receive a TNS error, there is a problem with the Oracle client configuration.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now