Solved

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

Posted on 2004-04-22
1
5,075 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 77

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
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 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…
Suggested Courses

630 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