Chapter 7: Handling ADO Events

Microsoft ActiveX Data Objects (ADO)

ADO 2.5

Chapter 7: Handling ADO Events

The ADO event model supports certain synchronous and asynchronous ADO operations that issue events, or notifications, before the operation starts or after it completes. An event is actually a call to an event-handler routine that you define in your application.

If you provide handler functions or procedures for the group of events that occur before the operation starts, you can examine or modify the parameters that were passed to the operation. Because it has not been executed yet, you can either cancel the operation or allow it to complete.

The group of events that occur after an operation completes are especially important if you use ADO asynchronously. For example, an application that starts an asynchronous Recordset.Open operation is notified by an execution complete event when the operation concludes.

Using the ADO event model adds some overhead to your application but provides far more flexibility than other methods of dealing with asynchronous operations, such as monitoring the State property of an object with a loop.

See Also

ADO Event Handler Summary | ADO Event Instantiation by Language | ADO Events | Event Parameters | Types of Events

© 1998-2003 Microsoft Corporation. All rights reserved.