RDO's StillExecuting Property in ADO ?

  • In RDO if the database connection included the rdAsyncEnable option the application did not block the query until it completed. This meant by using the StillExecuting Property you give the user the option to cancel the query in VB like this

    Do While rsResults.StillExecuting = True

    IF bolCancelled = True then rsResults.Cancel

    Exit Sub

    End If

    Loop.

    How would you code the equivalent using an ADO connection?

  • Have a look at the State property, that might be what you're after.

    Hope this helps

    Phill Carter

    --------------------

    Colt 45 - the original point and click interface

    Edited by - phillcart on 08/28/2003 07:09:41 AM

    --------------------
    Colt 45 - the original point and click interface

  • thanks Phill

  • hi!

    you can check the state of ADO connections/recordsets/commands to see what ADO does if you executed a statement asynchronously (this usually requires the adAsyncExecute constant to be used, eg. in ADODB.Connection.Execute).

    the state is implemented as a property called "state" and will carry a value of adStillExecuting if a statement is not yet finished. be careful, the state constants ar ORed together and will have to be ANDed for "decoding".

    you can use eg. the ADODB.Connection.ExecuteComplete event to check whether an asynchronous statement has completed (in VB you would declare your instance variable as WITH EVENTS and the add a handler, for other languages you'll have to elaborate in COM programming 😉

    for a comprehensive ADO reference look at:

    http://msdn.microsoft.com/library/en-us/ado270/htm/mdaobj01.asp?frame=true

    best regards,

    chris.

  • Declare Connection object line below

    dim withevents ConDB as ADODB.Connection

    so now u can see the default events that has been added to the list. In that events u can place appropriate message.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply