Object Events

SQL-DMO

SQL-DMO

Object Events

Some SQL-DMO objects support events. Automated OLE object events provide a callback mechanism and SQL-DMO uses events to signal an application conditionally. The SQL-DMO application can handle raised events to provide intelligent interaction with the user during a long-running process and to handle abnormal conditions. For example:

  • The PercentComplete event of a Backup object informs the application of backup progress. The application can use the callback to update a progress control or check for a user action, such as a request for cancellation.

  • The ConnectionBroken event of a SQLServer object informs the application that the network connection between the client and an instance of Microsoft® SQL Server™ has been lost. The application could notify the user and prompt for authorization information for a reconnection attempt.