AnyDAC
ContentsIndexHome
PreviousUpNext
TADDataSet.IndexName Property

Gets / sets the current index for the dataset by its name.

Group
Links

Use IndexName to specify the current index for the dataset. 

If IndexName is empty, the dataset's sort order is based on the IndexFieldNames property or on its default ordering as it is in dataset. If IndexName contains a name of valid index from Indexes collection, then that index is used to determine data view (including sort order) of records. 

IndexFieldNames and IndexName are mutually exclusive. Setting one clears the other. 

property IndexName: String;
with ADMemTable1.Indexes.Add do begin
  Name := 'by_name';
  Fields := 'NAME;DT';
  Active := True;
end;
ADMemTable1.IndexName := 'by_name';
What do you think about this topic? Send feedback!