I am making changes to a legacy VB 6 application. My VB code looks like this:
Dim cn As New ADODB.Connection
cn.CursorLocation = adUseClient
cn.Open "DSN=MYDB"
I get the following error (although the code is working in the legacy production system)
Run-time error '-2147467259 (80004005)':
[Microsoft][ODBC driver for Oracle][Oracle]ORA-12154: TNS:could not
resolve service name
My DSN entry (it's a System DSN, using the Microsoft ODBC Driver for Oracle) looks like this:
Data Source Name: MYDB
Description: My Database
User Name: user/password
Server: DBD
My TNSNAMES.ORA file looks like this:
DBD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = mydb.mydomain.com)(PORT = 1521))
)
(CONNECT_DATA =
(SID = DBD)
)
)
I am trying to run this using client version 8.1.7 on Windows 2000, and the database server has 8.1.6
I can do TNSPING DBD and it works fine.
I can connect to the database using SQL Plus without problems.
What could my problem be?
Start Free Trial