Database Object

See AlsovbobjDatabaseSee              PropertiesvbobjDatabaseProp               MethodsvbobjDatabaseMth


A database is a collection of data related to a specific topic or purpose.  A database can contain tables, queries, and indexes.  A Database object is a logical representation of a physical database.


The Database property of a data control is the only way to get access to a Database object without using the Professional Edition.  The Database property is a Database object representing the source of data appearing in other controls boundLVLJ7W to the data control and corresponds to the database specified by the DatabaseName and Connect properties of a data control.

Database objects have properties and methods you can use to manage your data.  You can use any methods of a Database object with the Database property of a data control, such as Close and Execute.  You can also examine the internal structure of the physical database by using the TableDefs collection of a Database object, and in turn, the Fields and Indexes collections of individual TableDef objects.

Professional Edition

With the Professional Edition, you can create object variablesZ3R9Q5 of type Database using the Dim and Set statements.  For example, the following code creates and opens a Database object:

Dim MyDb As Database
Set MyDb = OpenDatabase("C:\VB\BIBLIO.MDB")