ICachedDataset.MasterSource

Syntax

MasterSource: ICachedDataset;

Description

The MasterSource property determines a data source that is the main one at linking of several data sources.

Example

Executing the example requires two tables with the Table_1 and Table_2 identifiers in repository.

Sub Main;

Var

MB: IMetabase;

DSInst, DSInst1: IDatasetInstance;

Cache, Cache1: ICachedDataset;

Begin

MB := MetabaseClass.Active;

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

DSInst1 := MB.ItemById("Table_2").Open(Null) As IDatasetInstance;

Cache := DSInst.OpenCached;

Cache1 := DSInst1.OpenCached;

Cache.IndexFields := "FIELD2";

Cache.MasterFields := "FIELD_2";

Cache.MasterSource := Cache1;

Cache1.First;

While Not Cache1.Eof Do

Debug.WriteLine(Cache.RecordCountAll);

Cache1.Next;

End While;

End Sub Main;

After executing the example, two tables are connected. The field of the main table from which the data is taken has the FIELD_2 identifier; the field of the dependent table, by which filtering according to data from the first table is performed, has the FIELD2 identifier. All records of the main table will be checked. Quantity of records in the linked table, received as a result of filtering by data of each record of the main table, is displayed in the console.

See also:

ICachedDataset