Re: Waiting for a recordset to finish fetching
- From: JoelB <JoelB@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jul 2007 17:22:03 -0700
Stephen,
DoEvents did the trick. Sticking it in the middle of my loop instead of a
comment appears to have been exactly what I needed.
Thanks so much for your help!
Joel
"JoelB" wrote:
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
- References:
- Re: Waiting for a recordset to finish fetching
- From: Stephen Howe
- Re: Waiting for a recordset to finish fetching
- From: JoelB
- Re: Waiting for a recordset to finish fetching
- Prev by Date: Re: How to protect data within MS access?
- Next by Date: Re: Cloned recordsets with SQL Server 2005
- Previous by thread: Re: Waiting for a recordset to finish fetching
- Next by thread: Re: number field comes in as integer
- Index(es):
Relevant Pages
|
|