• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. INTRODUCING ACTIVEX DATA OBJE... > OPENING A CONNECTION TO A DATABASE

OPENING A CONNECTION TO A DATABASE

You first need to open a connection to a database. As in DAO, creating a reference to a database is pretty straightforward in ADO.

Connecting to the Current Database

Connecting to the current database (or project, as is popular in Access 2000) is the easiest of all. To perform this task, you use the CurrentProject object, which is a property of the Application object. The CurrentProject object has a Connection property, which you assign to a Connection object. You can see this in the following code, which prints the ConnectionString property to the Immediate window:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint