VBA/Excel/Access/Word/Access/Oracle

Материал из VB Эксперт

Перейти к: навигация, поиск

connect to Oracle

 
Sub Oracle()
    Dim conn As ADODB.Connection
    Set conn = New ADODB.Connection
    With conn
        .Provider = "MSDAORA"
        .ConnectionString = "Data Source=Catwoman;User ID=steve;Password=steve"
        .Mode = adModeRead
        .Open
    End With
    MsgBox "Connected to " & conn.Provider, vbInformation
End Sub