About QueryrecCount&FetchAll.

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
capelin
Posts: 14
Joined: Fri 05 Mar 2010 05:39

About QueryrecCount&FetchAll.

Post by capelin » Wed 04 Aug 2010 06:56

For Unidac3.00.0.10,I have problem:
For Mysql,
FetchAll:=False,QueryrecCount:=False,The RecordCount is 25.
FetchAll:=False,QueryrecCount:=True,The RecordCount is all record.FetchAll Funtion is invalid.
But I want Showing real RecordCount on FetchAll:=False.Why?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 04 Aug 2010 10:15

If QueryRecCount = True, and FetchAll = False, TCustomMyDataSet performs additional query to get the record count for this SELECT, so the RecordCount property reflects the number of records of the whole result set that is the count of records that will be fetched.
If QueryRecCount = False, RecordCount reflects the number of fetched records. To fetch next batch of records use the Next method.

capelin
Posts: 14
Joined: Fri 05 Mar 2010 05:39

Post by capelin » Wed 04 Aug 2010 15:11

I need to FetchAll = False effect, and hope the RecordCount return to the results of this query. How?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 05 Aug 2010 08:37

If FetchAll = False, and QueryRecCount = False, RecordCount reflects the number of fetched records. RecordCount will increase after every next fetching of batch of records.

Post Reply