Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle and Visual Basic 6.0

Status
Not open for further replies.

VBQuery

Programmer
Apr 2, 2001
14
US
Hi all
I want to connect to the oracle data base through vb.
I am totally new to Visual Basic. Please tell me how do I do it using ADODB thing....
ANd also can u please suggest me any website which can give me a complete idea of working with Oracle in VB.

Thanks in advance
 
Code:
Dim connDB as ADODB.Connection

'DBU - database username
'DBP - database password
'DBInst - database instance name

With connDB
    .ConnectionString = "PROVIDER=MSDAORA;USER ID=" & DBU & _
        ";PASSWORD=" & DBP & _
        ";DATA SOURCE=" & DBInst & ";"
    .CursorLocation = adUseClient
    .Open
End With
 
Hello Sauerc
My code is like this:

Private Sub Form_Load()
Dim adoCon As New ADODB.Connection
Dim strCon As String
strCon = "Provider=MSDAORA; Data Source=_data_source_name; User ID=_user_ID_; Password=_pwd_;"
adoCon.Open strCon
End Sub


I tried this simple code but its always giving a RUn time error "-2147467259" and says Oracle error occured but the message could not be retrieved.

what can I do to make this working....

Thanks

 
Do you have the Oracle client installed on your PC? The MSDAORA provider needs it.

Here's a quick test -- run the VisData application that ships with VB. If you can get it to connect, then use the same parameters in your code.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top