DefaultDatabase Property

Indicates the default database for a Connection object.

Settings and Return Values

Sets or returns a String that evaluates to the name of a database available from the provider.

Remarks

Use the DefaultDatabase property to set or return the name of the default database on a specific Connection object.

If there is a default database, SQL strings may use an unqualified syntax to access objects in that database. To access objects in a database other than the one specified in the DefaultDatabase property, you must qualify object names with the desired database name. Upon connection, the provider will write default database information to the DefaultDatabase property. Some providers allow only one database per connection in which case you cannot change the DefaultDatabase property.

Applies To

Connection

he collection corresponding to the Index argument, an error occurs. Also, some collections don't support named objects; for these collections, you must use ordinal number references.

The Item property is the default property for all collections; therefore, the following syntax forms are interchangeable:

collection.Item(Index)
collection(Index)

Note The Item property may not be exposed in all programming environments. If it is not available, you must use the abbreviated syntax above.

Applies To

Errors, Fields, Parameters, Properties