.RecordCount in AfterFetch = 0?

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

.RecordCount in AfterFetch = 0?

Post by Ludek » Wed 04 Jun 2014 13:14

Hi,
I have TMSQuery with fetchall = false. Sometimes I'm getting invalid value (0) in .RecordCount property in the AfterFetch event, although I can see many fetched records in a dbgrid (> 20). This happens especially on SECOND opening of then same query component (query.open -> 30 (ok). query.close, query.open -> 0 (wrong)). In the subsequent afterfetch call (dataset got scrolled) is the value again ok.

Is this known behavior? Is there some other way to get ALWAYS correct count of fetched record in afterfetch event?

Thanks, Ludek.

Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Re: .RecordCount in AfterFetch = 0?

Post by Ludek » Wed 04 Jun 2014 13:24

tested with delphi xe & sdac 5.0.0.5 and also delphi xe6 & sdac 6.10.19. the same behavior detected.

Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Re: .RecordCount in AfterFetch = 0?

Post by Ludek » Wed 04 Jun 2014 13:41

I can also see, that in .data.recordcount is the right value...

Ludek
Posts: 301
Joined: Thu 12 Oct 2006 09:34

Re: .RecordCount in AfterFetch = 0?

Post by Ludek » Wed 04 Jun 2014 13:58

i can perhaps see the problem. in afterfetch is (when 2nd time opening the dataset) the dataset.state = dsinactive!

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: .RecordCount in AfterFetch = 0?

Post by azyk » Thu 05 Jun 2014 12:43

Hi,

Thank you for the information. We will change this behavior in one of the next versions.

Post Reply