Stop fetching

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Alkatraz3
Posts: 7
Joined: Fri 30 May 2008 09:45

Stop fetching

Post by Alkatraz3 » Mon 09 Jun 2008 19:09

Ok, simple question, since my previous thread somehow avoid attention - how to stop fetching?

I know it sounds stupid, but i cant stop fetching process - for example, i need to stop fetching, if current record count is above 500 records. NonBlocking is set to true, FetchAll true and QueryRecordCount to False. When i open dataset it begin to fetch records and when it reaches 500 i set the Cancel property to True in the BeforeFetch event. But when i trace it - it still continue to fetch. Then i tried to BreakExec it from another thread. If i set Cancel = Not DataSet.Fetching then it seems to stop, but Fetching property is still True, even if it act like it is False...

I dont understand - what is wrong? How to correctly stop fetching data on demand?

Delphi 2007/Vista/SDAC4.35

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Wed 11 Jun 2008 15:23

It was a bug in SDAC. We have fixed it. This fix will be included in the nearest build of SDAC.

Alkatraz3
Posts: 7
Joined: Fri 30 May 2008 09:45

Post by Alkatraz3 » Fri 13 Jun 2008 12:26

Oh, i see... Have to wait for next build then...

So to stop fetching i must set Cancel property to true, or call BreakExec from another thread, correct? Or i must track Fetching property in OnBeforeFetch event and Cancel once it False?

And another question - you mention you can make asynchronous opening of datasets in future, so any hint when it will be implemented?

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 17 Jun 2008 07:58

The build with this fix has already been released.

> So to stop fetching i must set Cancel property to true, or call BreakExec from another thread, correct?
Yes, you are right.

> And another question - you mention you can make asynchronous opening of datasets in future, so any hint when it will be implemented?
At the moment I cannot specify the exact time for this task. We will try to implement it as soon as possible.

Alkatraz3
Posts: 7
Joined: Fri 30 May 2008 09:45

Post by Alkatraz3 » Tue 17 Jun 2008 15:22

I see... Thanks for answers.

Post Reply