Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Trying to pull SQL from Oracle via VBScript - Help required connecting

DreamscapeukDec 18 2010 — edited Dec 18 2010
Hi,
I really need some help please as I’m new to vbscripting and TNS connections and all this complicated stuff.
I’m trying to make a connection from one of our Oracle servers and extract some basic data via SQL commands but after trying for a couple of days I’m stumped.

Here’s the details and I hope someone can advise me in a simple language on where I’m going wrong.


The server I am trying to connect from is an Essbase server which already has an ODBC connection to the Oracle server setup in the ODBC Datasource Administrator. The driver that I can see in the ODBC Datasource Administrator is ‘Oracle in OraClient10g_home1’ and a ‘SQL Sever’ driver along with some MEARNT OEM drivers.
The tnsnames.ora has the information for the Oracle server and I can tnsping to it successfully.
Browsing round the web I have tried a couple of methods to connect:


"Driver={Microsoft ODBC for Oracle};Dbq=ABCD;Uid=LOGIN;Pwd=PASSWORD;"
I get the error message:
'Provider is not specified and there is no designated default Provider.'


I understand that I don’t have the Microsoft ODBC for Oracle driver installed, not sure if we need it if we have the Oracle in OraClient10g_home1 driver and already have a connection set up. So I tried:


"Driver={ Oracle in OraClient10g_home1 };Dbq=ABCD;Uid=LOGIN;Pwd=PASSWORD;"

Again.. 'Provider is not specified and there is no designated default Provider.'

I also tried another method suggested:


Dim strCon

strCon = "Driver={Oracle in OraClient10g_home1}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
         "(HOST=EssbaseServer)(PORT=1592))" & _
         "(CONNECT_DATA=(SERVICE_NAME=ABCD))); uid=LOGIN;pwd=PASSWORD;"

Dim oCon: Set oCon = WScript.CreateObject("ADODB.Connection")
Dim oRs:  Set oRs  = WScript.CreateObject("ADODB.Recordset")
oCon.Open strCon
oCon.Close

Set oRs = Nothing
Set oCon = Nothing
Same error message again:
Provider is not specified and there is no designated default Provider.

This leads me to believe that maybe I need to have the Microsoft ODBC for Oracle drivers installed on the server. Maybe I need to set my script differently and am totally doing it wrong. Any help please? If you think I need the driver could you please explain why and how it works so I can put forward for my arguement to install it on the server.

Many thanks
This post has been answered by Saubhik on Dec 18 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2011
Added on Dec 18 2010
2 comments
2,388 views