DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
Go Back  Xtreme Visual Basic Talk > > > DNS-less Oracle ODBC connection string


Reply
 
Thread Tools Display Modes
  #1  
Old 01-11-2008, 09:54 AM
gubbs gubbs is offline
Centurion
 
Join Date: Sep 2002
Location: Georgia
Posts: 112
Default DNS-less Oracle ODBC connection string


All,

I have a question. In my VS2005 code, I wish to create a DNS-less connection string to an Oracle database (9i and 10g). When I search the web, I get hits similar to this:

oConn.Open("Driver={Oracle ODBC Driver};" & _
"Dbq=myDBName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword")

I'm assuming that {Oracle ODBC Driver} should be replaced with the actual driver name. However, I don't know the syntax of what should be the oracle driver name and I can't find an example of one on the web.

Your help will be greatly appreciated. Thanx!
__________________
Gubbs
Reply With Quote
  #2  
Old 01-11-2008, 11:59 AM
lebb's Avatar
lebbDNS-less Oracle ODBC connection string lebb is offline
Disillusioned Code Poet

Retired Moderator
* Guru *
 
Join Date: Apr 2002
Location: Tennessee, USA
Posts: 12,808
Default

I think that's correct if you are using the Oracle-provided ODBC driver. You'll find examples using the Microsoft-provided Oracle driver here. There are also examples there using OLEDB and ODP.NET, both of which should give you significantly better performance than ODBC.
__________________
Laura

Ita erat quando hic adveni.
Reply With Quote
  #3  
Old 01-11-2008, 12:26 PM
gubbs gubbs is offline
Centurion
 
Join Date: Sep 2002
Location: Georgia
Posts: 112
Default

Laura,

Thanx for the suggestions about OLEDB and ODP.NET, but in this case, I must use ODBC.

I tried verbatim that example code (entering the correct info for db name, uid and pswd of course), but it kept throwing an error. So you're saying that Driver={Oracle ODBC Driver} is the proper way of referencing an Oracle ODBC driver? The link you provide has 'server' rather than 'dbq'. I'll try that. Thanx for the help!
__________________
Gubbs
Reply With Quote
  #4  
Old 01-11-2008, 12:44 PM
gubbs gubbs is offline
Centurion
 
Join Date: Sep 2002
Location: Georgia
Posts: 112
Default

Laura,

Hmm. That doesn't work either. I can communicate with the database using a dns type connection string and I can communicate with it using an OLEDB connection string. But I keep getting an error when I attempt a dns-less connection string.
__________________
Gubbs
Reply With Quote
  #5  
Old 01-11-2008, 12:49 PM
gubbs gubbs is offline
Centurion
 
Join Date: Sep 2002
Location: Georgia
Posts: 112
Default

Laura,

I'm making a bit of progress here. When I use the Microsoft ODBC Driver ({Microsoft ODBC for Oracle}), I can communicate. So problem must be:

1. The Oracle ODBC driver (I know it's installed on my machine)
or
2. The syntax I'm using to reference the Oracle ODBC driver is incorrect.

I'll keep hunting.
__________________
Gubbs
Reply With Quote
  #6  
Old 01-14-2008, 08:10 AM
lebb's Avatar
lebbDNS-less Oracle ODBC connection string lebb is offline
Disillusioned Code Poet

Retired Moderator
* Guru *
 
Join Date: Apr 2002
Location: Tennessee, USA
Posts: 12,808
Default

I confirmed that the syntax is correct for the Oracle ODBC driver. You mention the difference between "server" and "dbq" in the string; this is a driver-specific difference. The Microsoft driver expects the "server" syntax while the Oracle driver needs "dbq". Following is Oracle documentation that details additional parameters you can specify in the connection string (although what you have should be adequate):
http://www.oracle.com/technology/doc...on_String_.htm

Check your tnsnames.ora file and make sure that the name specified there is the same one you are specifying in the dbq attribute, and that it is correctly configured to point to the appropriate Oracle server. Also make sure you don't unintentionally have an additional tnsnames.ora file in your application path that points somewhere different, as it will override the default one if present.
__________________
Laura

Ita erat quando hic adveni.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
 
DNS-less Oracle ODBC connection string
DNS-less Oracle ODBC connection string
 
-->