3
votes

I have installed Oracle 11 G client(Administrator option) in my machine Windows 7 64 bit.

This the path of the oracle home

C:\app\anoop2\product\11.2.0\client_1

"Path" of environment variables are also pointing to

C:\app\anoop2\product\11.2.0\client_1\bin;
C:\app\anoop2\product\11.2.0\client_1;

Now, though i am able to connect to server through my SQL developer, i am not able to connect it using VB 6. This is the code i am using

Dim aConn As ADODB.Connection
 Set aConn = New ADODB.Connection
 aConn.Open "PROVIDER=MSDAORA.1;PASSWORD=XXX;User ID=XXX;Data Source=XXX;Persist Security Info=True"

This is my tnsnames.ora file

DEV = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = XXX)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = DEV) ) )

I am not able to find a listener file in my machine. I am getting an error "TNS: Listener was not given the SERVICE_NAME in CONNECT_DATA". Any pointers and suggestions are really appreciated.

Thanks, Anoop

1
Please check your environment one more time. C:\>dir /s/b tnsnames.ora C:\>echo %PATH% C:\>sqlplus system@DEV Data Source=DEV or you can also try: Data Source= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = XXX)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = DEV) ) )Bjarte Brandt

1 Answers

1
votes

Check listener log and verify service name in DBA_SERVICES view. In your setup, double check "Data Source" value