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

How do I make an ODBC connection to Oracle?

P: 11
I'm having trouble making an ODBC connection using VB.NET 2005. I have tried nearly every connection string found on, in almost every format I can think of.

I have tried both of the following drivers, as well.
Oracle ODBC Driver (version
Microsoft ODBC for Oracle

Basically, I end up with the same generic error no matter what I try. Here's my code.

Expand|Select|Wrap|Line Numbers
  1.         Try
  2.             ODBCConnection.ConnectionString = "Driver={Microsoft ODBC for Oracle};Server=xxxx;Uid=xxxx;PWD=xxxx;"
  3.             ODBCConnection.Open()
  4.         Catch ex As Exception
  5.             MessageBox.Show(ex.Message.ToString)
  6.         End Try
The following error occurs when I try to open the connection.

[ODBC driver for Oracle][Oracle]ORA-12162: TNS:service name is incorrectly specified
[ODBC Driver Manager] Driver's SQLSetConnectAttr failed
[ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).

It may also be worth noting that changing from Microsoft's Oracle driver, to Oracles driver, gives me a simple [General Error] when I try to open the connection.

I've been struggling with this for a week or more...any help to get me connected would be much appreciated.
Jul 11 '07 #1
Share this Question
Share on Google+
3 Replies

P: 3
have you tried using
Jul 11 '07 #2

P: 11
It requires Oracle 8.1.7 or greater. I'm running 8.1.5 and upgrading is not an option due to compatibility issues with other software we're running.
Jul 11 '07 #3

P: 11
I'm now getting...

ORA-12162 TNS:net service name is incorrectly specified
Jul 11 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.