Recently, I found a problem when using the RecordCount property of TUniQuery to determine how many records there are. No matter how many records are queried, the RecordCount property always returns 25. Is there anyone else like me? Is this a bug?
PS: The UniDAC version I am using is 8.4.4 and the SQLite version is 3.34.1.
The RecordCount property of the TUniQuery component has a bug
-
- Posts: 16
- Joined: Fri 13 Dec 2019 16:39
Re: The RecordCount property of the TUniQuery component has a bug
Hello,
The 25 records may be the default settings of Fetch property.
Try set FetchAll := true;
Regards
M
The 25 records may be the default settings of Fetch property.
Try set FetchAll := true;
Regards
M
Re: The RecordCount property of the TUniQuery component has a bug
To get the actual number of records, you need to use either the TUniQuery.Options.QueryRecCount property:
https://www.devart.com/unidac/docs/deva ... ccount.htm
var
RecordCount: Integer;
begin
UniQuery1.Options.QueryRecCount := True;
UniQuery1.SQL.Text := 'SELECT * FROM Dept';
UniQuery1.Open;
UniQuery1.RecordCount;
end;
https://www.devart.com/unidac/docs/deva ... ccount.htm
var
RecordCount: Integer;
begin
UniQuery1.Options.QueryRecCount := True;
UniQuery1.SQL.Text := 'SELECT * FROM Dept';
UniQuery1.Open;
UniQuery1.RecordCount;
end;