Home » Infrastructure » Windows » how to establish connectoin using ODBC driver from oracle 8i to VB6
how to establish connectoin using ODBC driver from oracle 8i to VB6 [message #146714] Sat, 12 November 2005 23:42 Go to next message
Prasanna Lakshmi
Messages: 2
Registered: November 2005
Location: Hyderbad
Junior Member
No Message Body
Re: how to establish connectoin using ODBC driver from oracle 8i to VB6 [message #147049 is a reply to message #146714] Tue, 15 November 2005 08:42 Go to previous messageGo to next message
Penfold
Messages: 112
Registered: June 2005
Senior Member
Conection using ADO, Code from Global Module: -

Public g_adoCnn As New ADODB.Connection

Public Function DBConnect() As Boolean
    '* Purpose  :   Connect to Database.
    
    g_adoCnn.ConnectionString = "Provider=MSDAORA;Password=password;User ID=user;Data Source=dbsource"
    g_adoCnn.Open
    
End Function

Public Sub DBDisconnect()
    '* Purpose  :   Disconnect from Database.
    
    g_adoCnn.Close
    
End Sub


Form Code: -

Option Explicit

Private Sub Form_Initialize()

    DBConnect
    
End Sub

Private Sub Form_Unload(Cancel As Integer)

    DBDisconnect
    
End Sub


Hope this helps?

Regards
Re: how to establish connectoin using ODBC driver from oracle 8i to VB6 [message #147672 is a reply to message #146714] Sat, 19 November 2005 00:25 Go to previous message
kiran
Messages: 503
Registered: July 2000
Senior Member
Just to add ,

1.You can add ADO objects to your current project using
Project->References->Microsoft ADO.......
2.The provider can be different (like MSDAORA (or) MSDAORA.1).

--Kiran.
Previous Topic: Newbie - Which options do I install
Next Topic: Oracle 9i in Windows 2003
Goto Forum:
  


Current Time: Fri Apr 19 04:18:29 CDT 2024