Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > connect vb with oracle

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-02, 22:41
lawboy lawboy is offline
Registered User
 
Join Date: Feb 2002
Posts: 1
connect vb with oracle

hi i'm new to vb and oracle, can someone give a an example on how to connect vb with oracle??
my main task is to generate random number then connect to oracle to check if critiera are met,

i need to submit my work soon. hope u all can help me asap
thanks
Reply With Quote
  #2 (permalink)  
Old 03-14-04, 14:01
SCIROCCO SCIROCCO is offline
Registered User
 
Join Date: Mar 2004
Location: www.scirocco.ca
Posts: 346
Re: connect vb with oracle

Dim cn as ADODB.Connection
Dim rs as ADODB.Recordset

Set cn = new ADODB.Connection

'For STANDARD Security
cn.ConnectionString = "Provider=OraOLEDB.Oracle;" & _
"Data Source=MyOracleDB;" & _
"User Id=myUsername;" & _
"Password=myPassword"

'For Trusted Security
cn.ConnectionString = "Provider=OraOLEDB.Oracle;" & _
"Data Source=MyOracleDB;" & _
"OSAuthent=1"

cn.open

set rs = new ADODB.recordset

rs.ActiveConnection = cn

rs.Open "SELECT * FROM Table1"

rs.Close

cn.Close

Set rs=Nothing
Set cn = Nothing
__________________
http://www.scirocco.ca/images/banner...occobanner.gif

Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

Or try our Ask An Expert service to answer any of your questions!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On