IQueryStorage.Enabled

Syntax

Enabled: Boolean;

Description

The Enabled property determines whether data can be saved.

Comments

If the property is set to True, data is possible to save for the query. Depending on the IQuery.AutoDefineStorage property value, the table used for saving is either determined from SQL query, or the Table or TableName properties should be used to specify it.

Example

Executing the example requires that the repository contains the Query object with the Query_1 identifier and a table with the TestTable identifier.

Sub UserProc;
Var
    MB: IMetabase;
    Query: IQuery;
    Storage: IQueryStorage;
Begin
    MB := MetabaseClass.Active;
    Query := MB.ItemById("Query_1").Edit As IQuery;
    Storage := Query.Storage;
    Storage.Enabled := True;
    Storage.Table := MB.ItemById("TestTable").Bind As ITable;
    (Query As IMetabaseObject).Save;
End Sub UserProc;

After executing the example, the settings of specified query are changed. Saving data is enabled for the query. Data is saved to the specified table of a repository.

See also:

IQueryStorage