MDAC 2.5 SDK - Technical Articles


 

Asynchronous Queries

Often operations involving a database can take some time to process a query, connect to the data store, or retrieve results to the client. Running a query asynchronously allows control to be returned to the application before the query is completed. Implementation of this feature enables the user to continue or cancel a query that takes a long time to run.

ADO 2.0 provides a way to do these operations asynchronously. With this ability, during a long operation, developers can also do other operations—for example, display a progress dialog box or continue painting the form, or even start other asynchronous operations.

Asynchronous operations can also be canceled. A query that takes too long can be stopped and restarted with a smaller result. A connection that takes too long can be canceled and another server tried.