Solved

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

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

Suggested Solutions

Title # Comments Views Activity
File generation using utl_file 4 55
What is the version of ojdbc6.jar 2 60
Queries 15 40
Email query results in HTML 6 20
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
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

810 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