ORA-12154 - trouble connecting in a vbscript
526032Aug 1 2006 — edited Aug 2 2006I am trying to connect to an oracle 9.2 database through a vbscript.
I am getting the following message.
"OraOLEDB: ORA-12154: TNS:could not resolve the connect identifier specified"
Here is my connection String.
strCon = "Provider=OraOLEDB.Oracle;User ID=TEST_PRD;Password=xxxx;Data Source=TEST_ONL_DEV;"
if I enter the command at the command prompt
tnsping TEST_ONL_DEV
I get
Used parameter files:
C:\oracle\ora92\network\admin\sqlnet.ora
Used LDAP adapter to resolve the alias
Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=fb
cmmkd1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=fbctd11)))
OK (0 msec)
My tnsnames.ora and sqlnet.ora are in the directory
C:\oracle\ora92\network\admin\
In my tnsnames.ora I have the entry for TEST_ONL_DEV
TEST_ONL_DEV =
(DESCRIPTION =
(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = lmmk132)(PORT = 1521)))
(CONNECT_DATA = (SERVICE_NAME = FBCTD11))
)
I have no trouble connecting to this database through my Embarcadero Rapid SQL program or running a query from SQL Plus.
If I change the connection to include the description I can connect with no problem
strCon = "Provider=OraOLEDB.Oracle; " & _
"Data Source=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=fbcmmkd1)(PORT=1521))" & _
"(CONNECT_DATA=(SERVICE_NAME=FBCTD11))); User ID=TEST_PRD;Password=xxxx;"
I am relativly new to Oracle. Can anybody give me some direction on why i might be getting this error.