A Database object contains the properties for a logical database in the data dictionary.

Stonefield Query uses the concept of a "main" database for an application. The main database is the one the user can change data sources for. All other databases are assumed to be related to the main one in that selecting the data source for the main one somehow determines how the data source for the others is selected.

For example, imagine an accounting application that has two databases: a system database that contains application-specific data, and a company-specific database containing the accounting information for the company. The user may have different databases for different companies, so they can change data sources to select the appropriate database for the desired company. However, there is only one system database. In this case, the company-specific database is considered to be the main one, since that's the one the user can select different data sources for.


NameData TypeDescription
ActiveBooleanTrue (the default) if the database is available to be queried on. Set this to False if the database should be disabled, such as if the database is optional and isn't available to this particular user. This setting is ignored for the main database.
ConnectedBooleanTrue if the database is currently connected to a data source.
CurrentDataSourceObjectA reference to the current DataSource object for this database.
DatabaseNameStringThe name of the database.
DataSourceNameStringThe name of the current data source for this database.
DataSourcesObjectA reference to the DataSources collection for this database.
DescriptionStringThe descriptive name for the database.
ErrorMessageStringThe text of any error that occurs.
MainDatabaseBooleanTrue if this is the main database for the application.
NameDelimitersStringThe delimiters used for names.
QuietBooleanTrue to not display error messages; the default is False.


ExecuteSQLStatementExecutes a SQL statement against the current data source for this database.
OpenDataSourceOpens the specified data source for this database.

See also

Databases Collection | DataSource Object | DataSources Collection