dsn-less odbc connection string for oracle

From: marshall lin <marshall_at_sightward.com>
Date: Mon, 1 Jul 2002 18:49:53 -0700
Message-ID: <4F7U8.87$V67.74215_at_news.uswest.net>


I don't have much experience with Oracle, I have been mostly using SQL server. I try to setup a dsn-less connection using oracle odbc driver to connect to an oracle datasource. I have the following connection that worked:

Set oConn = New ADODB.Connection

oConn.Open "Driver={Oracle in oraHome90};" & _

"Dbq=myDBName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"
where "myDBName" is defined in the tnsnames.ora file and "Oracle in oraHome90" is the oracle odbc driver name after it is installed.

This works fine and I am able to connect the the oracle datasource described in myDBName.

I noticed that oraHome90 in the Driver name can be changed if user choose a different name other than "oraHome90". Then I will have to go back and change the driver name. this is incovenient. especially I have the DLL already compiled and distributed with the default name (i.e. oraHome90) in it.

In SQL server, the odbc connection string is always:

driver={sql server};server=mySQLServer;database=myDB;

regardless of the installation.

I wonder if in oracle there is something similar for the driver name that is independent of the installation. Since I am new to oracle, I am not sure if I am doing the right thing here. why the driver name is 'Oracle in oraHome90' where oraHome90 can be modified by installation.

BTW: I did try the following, but no success.

            oConn.Open "Driver={Oracle ODBC Driver};" & _

"Dbq=myDBName;" & _
"Uid=myUsername;" & _
"Pwd=myPassword;"

thanks in advance for your help. Received on Tue Jul 02 2002 - 03:49:53 CEST

Original text of this message