Question - how to cancel ADO query in progress 
Author Message
 Question - how to cancel ADO query in progress

Hi.

I have a form that opens a recordset that could return a large number of
records. They are used to populate a listview control. I would like to be
able to cancel the recordset Open method while it's in progress, but still
use records that were retrieved before the Open method was canceled. Any
ideas, please?

Adrian



Sat, 24 May 2003 03:00:00 GMT  
 Question - how to cancel ADO query in progress
Would something simple like this work for you (pseudo code):

    rs.Open...
    loop
        Fill In List View With Current Record
        Check For Cancel
             Exit Loop
        rs.MoveNext
    end loop

Until the Open finishes, you can't retrieve records.  Were you thinking of
the Asynchronous Callback functions in ADO?  Using these still wouldn't
allow you to fill in part of a table, because the Open has to finish before
you can retrieve anything.

Not sure if this helps.


Quote:
> Hi.

> I have a form that opens a recordset that could return a large number of
> records. They are used to populate a listview control. I would like to be
> able to cancel the recordset Open method while it's in progress, but still
> use records that were retrieved before the Open method was canceled. Any
> ideas, please?

> Adrian



Sat, 24 May 2003 03:00:00 GMT  
 Question - how to cancel ADO query in progress
I think what I need is the async connection that I can cancel.


Quote:
> Would something simple like this work for you (pseudo code):

>     rs.Open...
>     loop
>         Fill In List View With Current Record
>         Check For Cancel
>              Exit Loop
>         rs.MoveNext
>     end loop

> Until the Open finishes, you can't retrieve records.  Were you thinking of
> the Asynchronous Callback functions in ADO?  Using these still wouldn't
> allow you to fill in part of a table, because the Open has to finish
before
> you can retrieve anything.

> Not sure if this helps.



> > Hi.

> > I have a form that opens a recordset that could return a large number of
> > records. They are used to populate a listview control. I would like to
be
> > able to cancel the recordset Open method while it's in progress, but
still
> > use records that were retrieved before the Open method was canceled. Any
> > ideas, please?

> > Adrian



Sat, 24 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Canceling an in-progress query (ADO/Jet 4.0)

2. Question on Cancel button using ADO Control

3. Question on Cancel button using ADO Control

4. Progress bar and cancel button!

5. Progress form with cancel button

6. How to cancel operation in progress?

7. ADO Query Status question

8. The SOLUTION to a question I posted on ADO parameterized queries

9. Question: Large Queries/Inserts w/Parameters w/ADO

10. Cancel a SQL pass-through query ??

11. Rdo and Oracle Cancel Query Problem

12. Problem with Cancel a Query...

 

 
Powered by phpBB® Forum Software