oracle database connection

G

Guest

I am trying to connect to an Oracle 10.2 database with vb.net and am getting
the error:

ORA-1215: TNS:could not resolve service name

My connection string is:
"Data Source=geobridge;UID=dba_geo_bridge;PWD=waterh0le"

and the datasource uses an {Oracle in OraClient} driver.

I have been doing a lot of surfing to locate possible problems and many of
them refer to an issue with a tnsnames.ora file, which I don't have on my
machine. I am successfully connecting to the same database using the same
machine from a C++ .Net program, so I know the individual values in the
connection string are good.

Any clues?

Thanks,
Stephanie
 
P

Paul Clement

¤ I am trying to connect to an Oracle 10.2 database with vb.net and am getting
¤ the error:
¤
¤ ORA-1215: TNS:could not resolve service name
¤
¤ My connection string is:
¤ "Data Source=geobridge;UID=dba_geo_bridge;PWD=waterh0le"
¤
¤ and the datasource uses an {Oracle in OraClient} driver.
¤
¤ I have been doing a lot of surfing to locate possible problems and many of
¤ them refer to an issue with a tnsnames.ora file, which I don't have on my
¤ machine. I am successfully connecting to the same database using the same
¤ machine from a C++ .Net program, so I know the individual values in the
¤ connection string are good.

Few questions to ask:

Is the Oracle client software installed?
What is the name of the driver used by the DSN displayed in the ODBC Administrator applet?
Can you connect with SQL Plus?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
G

Guest

In answer to your questions, Yes I've got OraNet Services loaded, the driver
is "Oracle in OraClient" and I can connect with SQL Plus.
 
R

RobinS

Thanks for posting your username and password. I'm sure someone will find
that helpful.

The error means that you have not added the information about your Oracle
database to the tnsnames.ora file. You'll have to search for it. It's under
an Oracle folder on your C drive (sometimes called oracle, sometimes called
orant, sometimes called ora92). And then maybe under \network\admin. It's
been a while since I had to know that, but I used to hit this problem all
the time.

The database you are accessing must be in that file. If it's in there, and
it still doesn't work, check the sqlnet.ora file. I used to work for a
large corporation, and they put info in the sqlnet.ora file for defaults,
and it overrode the tnsnames.ora file, and I was always having to go rename
the sqlnet.ora file.

Robin S.
Ts'i mahnu uterna ot twan ot geifur hingts uto.
 
P

Paul Clement

¤ In answer to your questions, Yes I've got OraNet Services loaded, the driver
¤ is "Oracle in OraClient" and I can connect with SQL Plus.
¤

The tnsnames.ora file provides the physical location of the database so in the absence of this file
you need to specify this information in the connection string. Below is an example which uses
Microsoft's ODBC driver for Oracle, but you can probably use Oracle's ODBC driver as well.

"Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=ServerName)(PORT=1500))" & _
"(CONNECT_DATA=(SERVICE_NAME=OracleDB))); uid=userID;pwd=password;"


Paul
~~~~
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top