Solved

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

Posted on 2004-04-22
1
4,968 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.

Join & Write a Comment

Suggested Solutions

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

708 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

13 Experts available now in Live!

Get 1:1 Help Now