Re: Waiting for a recordset to finish fetching



Stephen,

I guess I was being a little careless in my terminology regarding fetch.
But, yeah, the point is that my theory is that ADO is still working on
building the recordset at the time the find executes.

I'm a little rusty on DoEvents, but I'm thinking that your suggestion is
that sticking DoEvents in the loop would enable ADO to keep processing its
tasks, effectively breaking the 'log jam' that is currently occurring in my
loop...

I'll give it a shot.

Thanks,
Joel

"Stephen Howe" wrote:

First this "Waiting for a recordset to finish fetching" is only true if you
have opened the Recordset as asynchronous. If you have not, the Fetching
does not apply.
Asynchronous applies to client-sided curosrs

If you open a Recordset, client-sided and you have not specified
asynchronous, then the Open() call will not return until all records are
built up in client-sided memory.

If you open a Recordset, server-sided, then the Open() call will return as
soon as CacheSize records has been retrieved or the end of the records which
ever is first.

It is not specified what happens if you ask for Server-sided and
asynchronous.
I should imagine asynchronous is ignored.

Do While rs.State <> adStateOpen
' (nothing)
Loop

Surely you want

Do While rs.State <> adStateOpen
DoEvents
Loop

to give ADO more time to complete its action?

Stephen Howe







However, within the loop, the state never changes. I actually included a
timer to prevent an endless loop, and when I add a debug.print inside the
loop, even when I set it for 15 seconds it still stays in the fetching
state
(9) for the full period. I guess the fetch is stalled while loop is
running.

Can anyone suggest an alternate way to wait until the recordset is built
before doing the find?

The platform is MS Access.

TIA,
Joel




.



Relevant Pages

  • Re: ADO cloned recordset doesnt return field names
    ... It had been awhile since I worked with ADO. ... > that you need to specifically loop through the recordset and use ...
    (microsoft.public.excel.programming)
  • Re: ADO vs. "Native Access"
    ... dao recordset to modify, or work with the forms data. ... loop through each record as ... If you declare and use ado ...
    (microsoft.public.access.modulesdaovba)
  • Do While not EOF looping through recordset twice.
    ... I've created an ADO recordset,at run-time, to hold VAccess configuration ... I step through the values and update them after each loop. ... recordset, one table has a value of 0 and the other has a value of 1. ...
    (microsoft.public.vb.database.ado)
  • Re: Moving row data to columns in a one to many
    ... Lots of examples using ADO on the web, particularly with SQL Server. ... Once you have a recordset you can loop ...
    (microsoft.public.excel.programming)
  • Re: DAO MUCH faster than ADO in this test
    ... DAO is well-known to be faster than ADO. ... Of course the DAO loop ran faster than the SQL loop; ... advantage of a table-type recordset, which only works on local tables. ... Dim starttime As Single, finishtime As Single ...
    (microsoft.public.access.modulesdaovba)