ConnectionBroken Event (SQL-DMO)

The ConnectionBroken event occurs when a connected SQLServer object loses its connection to a Microsoft® SQL Server™ installation.

Applies To

SQLServer Object

Syntax

Private Function object_ConnectionBroken( Message as String ) as Boolean

Part Description
object Expression that evaluates to an object in the Applies To list
Message String containing descriptive message text

Remarks

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 the SQL Server installation 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.

Prototype (C/C++)

HRESULT ConnectionBroken(SQLDMO_LPCSTR Message,
LPBOOL Retry);

See Also

AutoReConnect Property

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.