I am using an Aynchronus Query to get data because i may have end up with 40 or 50,000 records. I want to give control to user to cancel at any point to the query. That i was able to do. But i want the total record count also for the query. When i am using recordset.recordcount it is taking a while and at this point user can not have any control to stop.
Is there a way to give control to user at this point or is there another way to get the rcordcount of my query without taking long time.
My code looks like this
rsADOTmp.Open rname, openqr_cnn, adOpenKeyset, adLockOptimistic, adAsyncExecute
While rsADOTmp.State = adStateExecuting 'Or cn.State = adStateOpen
If SQL_Execute_cancel = True Then
SQL_Execute_cancel = False
gcount = rsADOTmp.RecordCount
Here it is taking a while.
If anybody know the answer please let me know