RecordCount is similar to PhysicalRecordCount and is the physical number of records in the file, including deleted records and records excluded by the filter.
For the number of active records, use ExactRecordCount. This can take a while, as it has to filter all records.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
var
FDB:TDbf;
begin
FDB:=TDbf.Create(nil);
FDB.FilePathFull:='.\';
FDB.TableLevel:=7;
FDB.tablename :='test.dbf';
Fdb.FieldDefs.Add('prjid',ftlargeint);
Fdb.FieldDefs.Add('no',ftstring,10);
Fdb.CreateTable;
Fdb.active:=True;
Fdb.AppendRecord([3556856671915480078,'1']);
Fdb.AppendRecord([3556856671915480078,'2']);
Fdb.AppendRecord([3556856671915480017,'3']);
Fdb.Filter:='prjid=3556856671915480078';
Fdb.Filtered:=True;
DataSource1.DataSet:=FDB;
ShowMessage(IntToStr(FDB.RecordCount));
end;
filter no effective
RecordCountis similar toPhysicalRecordCountand is the physical number of records in the file, including deleted records and records excluded by the filter.For the number of active records, use
ExactRecordCount. This can take a while, as it has to filter all records.