State Property - ADO

Describes the current state of an object following an asynchronous operation.

Applies To

Command, Connection, Recordset

Required Files

msado15.dll
VC: adoint.h, adoid.h

Return Values

Constant Description
adStateClosed (Default) The object is closed.
adStateOpen The object is open.
adStateConnecting The object is connecting.
adStateExecuting The object is executing.

Remarks

When any of the Execute or Open methods are called asynchronously (i.e., with the adRunAsync option), you can use the State property to determine what’s happening at any time. For example, if a method is still executing, the State property will return adStateOpen + adStateExecuting. Or, if execution is waiting on a connection, the State property will return adStateConnecting.

When an error occurs on an asynchronous method, there is no way for ADO to notify the user of the error. Instead, ADO returns a runtime error the first time that the State property is read following the original error’s occurrence.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.