By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,187 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

oracle database connection

P: n/a
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
Mar 2 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Fri, 2 Mar 2007 05:39:00 -0800, Stephanie Doherty <St**************@discussions.microsoft.com>
wrote:

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)
Mar 2 '07 #2

P: n/a
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.

"Paul Clement" wrote:
On Fri, 2 Mar 2007 05:39:00 -0800, Stephanie Doherty <St**************@discussions.microsoft.com>
wrote:

¤ 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)
Mar 2 '07 #3

P: n/a
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.
----------------------------------------------------------
"Stephanie Doherty" <St**************@discussions.microsoft.comwrote in
message news:99**********************************@microsof t.com...
>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

Mar 2 '07 #4

P: n/a
On Fri, 2 Mar 2007 08:10:05 -0800, Stephanie Doherty <St**************@discussions.microsoft.com>
wrote:

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)
Mar 5 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.