The Connections Collection

As you saw in the section entitled Opening and External Database, you can open an ODBCDirect database using the OpenDatabase method against an ODBCDirect workspace object. Similarly, you can also open an ODBCDirect connection using the OpenConnection method of the ODBCDirect workspace.

When you open an ODBCDirect Connection object, it is automatically added to the Connections collection, and a corresponding Database object is added to the ODBCDirect workspace's Databases collection. When you close the Connection object, both the Connection and Database objects are removed from their respective collections. You can refer to a Connection object as:

DBEngine(0).Connections("Connection name") DBEngine(0).Connections(0)

Once a connection is established, you can open Recordsets, create QueryDefs and TableDefs, and just about anything else you can do using a Jet workspace.

0 0

Post a comment