Advantage TDataSet Descendant
Retrieves the current record number.
function AdsGetRecordNum : Longint;
CAUTION It is recommended that this Advantage extended method not be used. Please read the Caution About Extended Methods for more information. The suggested native Delphi method to use instead is: TTable.GotoBookmark. See your Delphi documentation for more information about this native Delphi method.
Each physical record in a table has a record number. The first physical record is number 1. All records, even deleted ones, have record numbers. The only way to change record numbers in a table is to perform an AdsPackTable.
If AdsTableOptions.AdsFilterOptions is IGNORE_WHEN_COUNTING, this function is very fast; the physical record number in the table is simply returned.
If AdsTableOptions.AdsFilterOptions is RESPECT_WHEN_COUNTING, this function will go to the first record in the table, skip through records that pass the filter, and count the records until the current record is reached. Thus, with large tables, this operation can be very slow. It is not recommended to use this function when AdsTableOptions.AdsFilterOptions is set to RESPECT_WHEN_COUNTING except on very small tables.
See AdsGetKeyNum to retrieve logical record numbers based on index orders.
SavePlace := AdsTable1.GetBookmark;
AdsTable1.FindKey( ['Smith'] );
{. . .your code here. . .}
Adstable1.GotoBookmark( SavePlace );