Computing.Net > Forums > Programming > establish a connection to database

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

establish a connection to database

Reply to Message Icon

Name: Anusha
Date: April 16, 2009 at 02:34:38 Pacific
OS: Windows XP
CPU/Ram: Pentium(R) 4 CPU 3GHz, 504 MB of RAM
Subcategory: Theory
Comment:


I should write one VB script that should retrieve data from one database
and display the same/store somewhere.
with google's help i wrote the below pgm but its not working..

Option Explicit
Dim strConn
strconn = "Driver={Microsoft ODBC for Oracle};
"CONNECTSTRING=(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=SERVERNAME)(PORT=1521)
(CONNECT_DATA=(SERVICE_NAME=MYDB)));uid=user;pwd=pass;"
'Create the connection
Dim connection
Set connection = CreateObject("ADODB.Connection")
'open connection
connection.Open strconn
'sql query to retrieve data
result = connection.execute("select * from tablename")
Msgbox result
'close the connection
connection.close

error I get is:
'provider is not specified and there is no designated default provider'

In addition, I am running this script in microsoft windows server 2003R2 64-bit SP2.
i got oracle 10g client installed in my system.

i have Host name,uid and pwd tat connect to the database..
b/w, what should we give for SERVICE_NAME.

Please help...thanks in advance



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


read file lines and store... batch file to read last f...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: establish a connection to database

Connecting to a MS-SQL Database www.computing.net/answers/programming/connecting-to-a-mssql-database/9681.html

How can I connect to NT server www.computing.net/answers/programming/how-can-i-connect-to-nt-server-/3050.html

Hello unable to connect to database www.computing.net/answers/programming/hello-unable-to-connect-to-database/19621.html