Condividi tramite


ConnectionBroken Event

Questa caratteristica verrà rimossa a partire da una delle prossime versioni di Microsoft SQL Server. Evitare di utilizzare questa funzionalità in un nuovo progetto di sviluppo e prevedere interventi di modifica nelle applicazioni in cui è attualmente implementata.

The ConnectionBroken event occurs when a connected SQLServer object loses its connection to an instance of Microsoft SQL Server.

Sintassi

Private Functionobject_ConnectionBroken(Message as String)asBoolean

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • Message
    String that contains descriptive message text.

Prototype (C/C++)

HRESULT ConnectionBroken(SQLDMO_LPCSTR Message,
LPBOOL Retry);

Osservazioni

SQL Distributed Management Objects (SQL-DMO) raises the ConnectionBroken event only when the AutoReConnect property of the SQLServer object is False. When AutoReConnect is True, SQL-DMO will not raise the event, even when automatic reconnection fails.

When a ConnectionBroken event handler returns True, SQL-DMO attempts to reconnect to an instance of SQL Server indicated when the Connect method of the SQLServer object connected successfully. When a ConnectionBroken event handler does not return a value, or returns False, SQL-DMO does not attempt to reconnect the SQLServer object upon return from the event handler.

Applies To:

Vedere anche

Riferimento