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
|