Visual Basic Reference

Database Property

See Also Example Applies To

Returns a reference to a Data control's underlying Database object.

Syntax

object.Database

Setdatabaseobject=object.Database (Professional and Enterprise Editions only)

The Database property syntax has these parts:

Part Description
databaseobject An object expression that evaluates to an valid Database object created by the Data control.
object An object expression that evaluates to an object in the Applies To list.

Remarks

The Database object created by the Data control is based on the control's DatabaseName, Exclusive, ReadOnly, and Connect properties.

Database objects have properties and methods you can use to manage your data. You can use any method 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 Database by using its TableDefs collection, and in turn, the Fields and Indexes collections of individual TableDef objects.

Although you can create a Recordset object and pass it to a Data control's Recordset property, you can't open a database and pass the newly created Database object to the Data control's Database property.

Data Type

Database