"ha jól sejtem akkor TDBF-el dolgozol vagy valami hasonló rettenettel. Ezekkel az volt a gond, hogy a törölt rekordok valójában nem törlődtek a táblából, csak kaptak egy jelzőt, hogy 'TÖRÖLVE'. Ha jól emlékszem akkor pack -ot kellett csinálni. Talán a TDBF oszálynak van is Pack vagy Packing metódusa."
Minden dBASE változat így működik.
Ezt használd:
function GetExactRecordCount: Integer;
A következőket kimásoltam a
TDBF manual
-ból:
5.5 Why does RecordCount return too many records?
When no index is active, the RecordCount property returns the total number of records in
the table including deleted ones. When an index is active, it returns a number based upon
internal index tree, usually very large. RecordCount is made for speed, and has the sequential
property, so TDBGrid can approximately show using it’s scrollbar the position of the current
record in the range.
If you need exact number of active records, use the ExactRecordCount function, which is very
slow (it reads all records from beginning to end).
7.7 ExactRecordCount
property ExactRecordCount: Integer read GetExactRecordCount;
Examine ExactRecordCount to determine the exact number of records in the current dataset.
This takes into account deleted, filtered and indexed records. This in contrary to Record-
Count, which will always give a rough upper bound estimate. Note that this property needs
to scan the complete dataset to find the number of records that are active, while RecordCount
is just a simple calculation.