HOWTO: Handle RDO 2.0 Asynchronous Processing WithEventsLast reviewed: October 16, 1997Article ID: Q172082 |
The information in this article applies to:
SUMMARYRDO 2.0 gives you the ability to handle asynchronous processing more elegantly than RDO 1.0. Because Visual Basic 5.0 allows objects to be dimensioned WithEvents, you can use the events of the object as if it were a visual control, such as a textbox, rather than constantly referring to properties such as StillExecuting.
MORE INFORMATIONThis project is an example of dimensioning object's WithEvents using the events of RDO 2.0's rdoConnection object. Be sure to change the connect string and query string to correctly connect to and query your database. The sample establishes an asynchronous connection to the database and runs an asynchronous query. When the asynchronous calls are made, the CommandButton on the form is disabled. The cbton is then re-enabled in the rdoConnection's QueryComplete and Connect event. This code is more elegant than using a timer to monitor the StillExecuting property repeatedly. In the code below, note that the rdoConnection object variable MyConn is treated almost like a visual control. From the code window, the MyConn object variable is available from the dropdown list of available objects.
Step-by-Step Example
REFERENCESFor more information on RDO 2.0's new functionality or on dimensioning objects WithEvents, please refer to the Visual Basic Help files or to Books Online.
|
Additional query words: WithEvents
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |