IDatasetInstanceField.Value

Syntax

Value: Variant;

Description

The Value property determines the value of data source field.

Comments

Value determined in this property must have the same data type as the one determined for the field. If the field has a custom type, the link to data stream is specified as the value. To read more about working with custom type fields, use the knowledge base in the articleWorking with fields that have custom data type.

Example

Sub Main;

Var

MB: IMetabase;

DSInst: IDatasetInstance;

Fields: IDatasetInstanceFields;

v, v1: Variant;

Cach: ICachedDataset;

Begin

MB := MetabaseClass.Active;

DSInst := MB.ItemById("Table_1").Open(Null) As IDatasetInstance;

Cach := DSInst.OpenCached;

Cach.Edit;

Fields := Cach.Fields;

Fields.Item(0).Value := 100;

v := Fields.Item(0).Value;

v1 := Fields.Item(0).OldValue;

Cach.Cancel;

End Sub Main;

After executing the example, the value of the first field in data source cache is changed, the "v" variable contains its new value, and the "v1" variable contains the old value of the field. After that all changes are cancelled.

See also:

IDatasetInstanceField