The RecordCount property of the TUniQuery component has a bug

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Wilson Alex
Posts: 16
Joined: Fri 13 Dec 2019 16:39

The RecordCount property of the TUniQuery component has a bug

Post by Wilson Alex » Thu 05 Aug 2021 15:24

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.

FCS
Posts: 176
Joined: Sat 23 Feb 2013 18:46

Re: The RecordCount property of the TUniQuery component has a bug

Post by FCS » Fri 06 Aug 2021 14:23

Hello,

The 25 records may be the default settings of Fetch property.
Try set FetchAll := true;

Regards
M

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: The RecordCount property of the TUniQuery component has a bug

Post by Stellar » Tue 10 Aug 2021 14:04

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;

Post Reply