ADODB Object
 
Syntax
 
long = commandobject.State
 
Description
Returns a long value describing if the Command object is open, closed or in the process of connecting, executing or retrieving.
The State property returns a long value that is the sum of one or more ObjectStateEnum constants. These constants describe if the Command object is open, closed, connecting, executing, or fetching. The default value is adStateClosed.
 
You can call the State property at any time.
 
ObjectStateEnum Constants 
 
Constant
Value
Description
adStateClosed
0
Object is closed
adStateOpen
1
Object is open
adStateConnecting
2
Object is connecting
adStateExecuting
4
Object is executing
adStateFetching
8
Object is fetching
See Also
Connection.State, Record.State, Recordset.State, Stream.State.
Example
 
If (objCommand.State = adStateClosed) Then
   Debug.Print "Command object is closed"
End If