Connect to databse through URL : ADODB.Connection « Access « VBA / Excel / Access / Word






Connect to databse through URL

 
Sub ConnectToURL()
  On Error GoTo Except
    Dim Connection As New ADODB.Connection
    Connection.Provider = "Microsoft.Jet.OLEDB.4.0"
    Const URL = "http://localhost/access/nwind.mdb"
    Connection.ConnectionString = "URL=" & URL
    Connection.Mode = adModeReadWrite
    Connection.Open
    MsgBox "Connected via " & Connection.Provider & _
        " OLE DB Provider!", vbInformation
    Exit Sub
Except:
    MsgBox Err.Description, vbCritical
End Sub

 








Related examples in the same category

1.Connection to database
2.Connect to current database
3.Creating a Connection Object
4.open up a schema with a provider to look at all the database objects
5.The Errors Collection
6.Connect to database with user name and password