Datasnap.DBClient.TCustomClientDataSet.GetRecNo
Delphi
function GetRecNo: Integer; override;
C++
virtual int __fastcall GetRecNo(void);
Properties
| Type | Visibility | Source | Unit | Parent |
|---|---|---|---|---|
| function | protected | Datasnap.DBClient.pas Datasnap.DBClient.hpp |
Datasnap.DBClient | TCustomClientDataSet |
Description
Returns the position of the active record in the dataset. GetRecNo is a getter method for the RecNo property. {{#multireplace:Datasnap.DBClient.TCustomClientDataSet.GetRecNo|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}} inherits from {{#multireplace:Data.DB.TDataSet.GetRecNo|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}. All content below this line refers to {{#multireplace:Data.DB.TDataSet.GetRecNo|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}.
Returns the position of the active record in the dataset. GetRecNo is a getter method for the RecNo property.
Use GetRecNo to get the ordinal position of an active record in the dataset. Datasets like TADOTable,TADODataSet, and TADOQuery inherit GetRecNo and override it according to their needs.
Important: When you implement GetRecNo in the derived classes, ensure that it returns the following values:
- -1 (if dataset is in dsInsert state)
- 0 (if dataset is empty)
- current record number (in other cases)