Home » Other » General » connect oracle through vb
icon5.gif  connect oracle through vb [message #121565] Mon, 30 May 2005 13:20 Go to next message
Messages: 3
Registered: April 2005
Location: pakistan
Junior Member

i am using vb and want to connect oracle database through vb.
pls help me
Re: connect oracle through vb [message #122036 is a reply to message #121565] Thu, 02 June 2005 08:54 Go to previous message
Messages: 112
Registered: June 2005
Senior Member

Here's two I'd use:-

OO4O (Oracle Objects for OLE)

Option Explicit

Dim m_oraSession As Object
Dim m_oraDatabase As Object

Private Sub Command1_Click()

    Set m_oraSession = CreateObject("OracleInProcServer.XOraSession")
    Set m_oraDatabase = m_oraSession.DBOpenDatabase("Database", "user/password", 0&)
    MsgBox "Connected to " & m_oraDatabase.Connect & "@" & m_oraDatabase.DatabaseName
End Sub

Private Sub Form_Unload(Cancel As Integer)

    Set m_oraDatabase = Nothing
    Set m_oraSession = Nothing
End Sub


Option Explicit

Public m_adoCnn As New ADODB.Connection
Public m_adoRst As New ADODB.Recordset

Public Sub Command1_Click()
    m_adoCnn.ConnectionString = "Provider=MSDAORA;Password=tiger;User ID=scott;Data Source=database"
End Sub

Private Sub Form_Unload(Cancel As Integer)

End Sub

Previous Topic: PLEASE help!!! the 1st record not displayed? in VB DataReport
Next Topic: What is alternet of cursor
Goto Forum:

Current Time: Sat Jun 10 20:56:41 CDT 2023