Connect to current database : ADODB.Connection « Access « VBA / Excel / Access / Word

Connect to current database

Sub ConnecttoSameDB()
    Dim conn As ADODB.Connection
    Set conn = CurrentProject.Connection
    MsgBox "Connected to " & conn.Provider
End Sub


Related examples in the same category

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