VB6 connection to Oracle DB with Instant_Client driver, not Oracle XE driver

I have a Visual Basic 6 app that currently connects fine to an Oracle database using the Oracle XE driver:

Set MyConn = New ADODB.Connection
MyConn.Open "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=Ora.mydomain.com)(PORT=1000)))(CONNECT_DATA=(SID=SVR)(SERVER=DEDICATED)));User Id=myuser;Password=mypassword;"

However, I need to change the program to use the Oracle Instant Client driver instead, and I am unable to get it to work. I've tried multiple formats but they all fail. Also, I do not have access to the user's TNSnames.ora file on their PC, so the connection string can not reference the user's TNS settings.

Any help would be greatly appreciated. Thanks.
Who is Participating?
slightwv (䄆 Netminder)Connect With a Mentor Commented:
>>driver={Oracle in instantclient_11_2}

This looks like the instant client install.

If the ODAC OLEDB install was successful, you should be able to use the same connect string you posted.

Double check the install.
slightwv (䄆 Netminder) Commented:
The OLEDB drivers are now part of the ODAC download.

I believe you no longer need the Instant Client as part of this download/install.

I would suggest the XCopy version:

Once you unzip the download, there is a readme type file that tells you how to install just the OLEDB drivers.
Alexander Eßer [Alex140181]Software DeveloperCommented:
I suppose you have to create multiple listeners, as shown here:

So, you're able to work with different Oracle homes...
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

slightwv (䄆 Netminder) Commented:
Not where listeners enter into the picture?  This is about a Client VB6 app using OLEDB to connect to a remote database server.  That is unless I'm completely missing the question...
tcloudAuthor Commented:
No, I don't think this is a listener issue. It works fine now the Oracle XE driver. I will use the same listener, but just a different client driver.

We want to stop using the Oracle XE driver because, to our knowledge, you need to install the full XE client database in order to use the XE driver.
slightwv (䄆 Netminder) Commented:
XE doesn't have a driver itself per say.  It installs native drivers as part of it's install.

Yes, I believe XE is a complete install or nothing but it's been a while since I installed it.

Check the ODAC drivers I mentioned above.
tcloudAuthor Commented:
Thanks, I'll try the ODAC.
tcloudAuthor Commented:
I can now connect to the database, but only if I reference the user's TNSnames.ora file. This works:

MyConn.Open "driver={Oracle in instantclient_11_2};DBQ=PROD;User Id=myuser;Password=mypassword;"

Is it possible to connect directly without using the TNS file?

tcloudAuthor Commented:
Fast and responsive solution. Was right on. I was just slow in implementing. Thanks so much for your help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.