VerifyConnection Method (SQL-DMO)

The VerifyConnection method tests the connection used by the SQLServer object.

Applies To

SQLServer Object

Syntax

object.VerifyConnection( [ ReconnectIfDead ] ) as Boolean

Part Description
object Expression that evaluates to an object in the Applies To list
ReconnectIfDead Long integer controlling method behavior as described in Settings

Settings
Constant Value Description
SQLDMOConn_CurrentState 2 Return True if connected.
SQLDMOConn_LastState 1 Return True if connected on last call and still connected, or not connected on last call and still not connected.
SQLDMOConn_ReconnectIfDead 6 Default. Attempt to reconnect the SQLServer object if the object has been connected and has lost its connection. Return True if connection exists.

Returns

True or False as described in Settings.

Prototype (C/C++)

HRESULT VerifyConnection(
LPBOOL pRetVal,
SQLDMO_VERIFYCONN_TYPE VerifyType = SQLDMOConn_ReconnectIfDead);


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