FireDAC.Comp.DataSet.TFDDataSet.GetRecNo

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetRecNo: Integer; override;

C++

virtual int __fastcall GetRecNo();

Properties

Type Visibility Source Unit Parent
function protected
FireDAC.Comp.DataSet.pas
FireDAC.Comp.DataSet.hpp
FireDAC.Comp.DataSet TFDDataSet

Description

Returns the position of the active record in the dataset. GetRecNo is a getter method for the RecNo property.

FireDAC.Comp.DataSet.TFDDataSet.GetRecNo inherits from Data.DB.TDataSet.GetRecNo. All content below this line refers to Data.DB.TDataSet.GetRecNo.

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)



See Also