Connection Object Events

Connection object events must be trapped by creating a WithEvents Connection object variable in a class module. Trapping these events is necessary whenever you are using a Connection object asynchronously, because these events are what notify your application that the Connection object has completed its task.

Covering asynchronous connections is beyond the scope of this chapter. However, they are important enough to deserve mention so you can pursue them further if you like. The two most commonly used Connection events are:

□ ConnectComplete — Triggered when an asynchronous connection has been completed. You can examine the arguments passed to this event to determine if the connection was successful or not.

□ ExecuteComplete — Triggered when an asynchronous command has finished executing.

0 0

Post a comment