TCustomBufDataset.AddIndex¶
Adds an index definition to the dataset.
Declaration¶
Source position: bufdataset.pas line 799
public
procedure TCustomBufDataset.AddIndex(const AName: string;
const AFields: string;
AOptions: TIndexOptions;
const ADescFields: string='';
const ACaseInsFields: string='')
; virtual;
Description¶
AddIndex is a procedure used to add an index definition to the dataset. AddIndex calls CheckBiDirectional to ensure that the UniDirectional property contains False. An exception is raised if UniDirectional contains True.
AddIndex checks for a valid value in the AFields argument. An Exception is raised when AFields is an empty string (''). In addition, an index added to an Active dataset cannot cause the index count to exceed the value in MaxIndexesCount. An Exception is raised if the index count would be larger than the value in MaxIndexesCount.
AddIndex creates a TBufDatasetIndex instance by calling InternalAddIndex using the arguments passed to the method. The new index is temporary when the Active property contains True; it will be discarded when the dataset is closed.
See also¶
| Name | Description |
|---|---|
| TCustomBufDataset.UniDirectional | Indicates if the dataset is for uni-directional navigation only. |
| TDataset.Active | Is the dataset open or closed. |
| TBufDatasetIndex |