ObjectStateEnum
Specifies whether an object is open or closed, connecting to a data source, executing a command, or retrieving data.Constant Value Description adStateClosed 0 Indicates that the object is closed.
adStateOpen 1 Indicates that the object is open.
adStateConnecting 2 Indicates that the object is connecting.
adStateExecuting 4 Indicates that the object is executing a command.
adStateFetching 8 Indicates that the rows of the object are being retrieved. ADO/WFC EquivalentPackage: com.ms.wfc.dataConstant
AdoEnums.ObjectState.CLOSED
AdoEnums.ObjectState.OPEN
AdoEnums.ObjectState.CONNECTING
AdoEnums.ObjectState.EXECUTING
AdoEnums.ObjectState.FETCHING 读一遍上面的内容可以每一次操作之前都去检查Connection.State
if Connection.State<>adStateOpen then
Connection.Open("You Connection String")
end if
Specifies whether an object is open or closed, connecting to a data source, executing a command, or retrieving data.Constant Value Description adStateClosed 0 Indicates that the object is closed.
adStateOpen 1 Indicates that the object is open.
adStateConnecting 2 Indicates that the object is connecting.
adStateExecuting 4 Indicates that the object is executing a command.
adStateFetching 8 Indicates that the rows of the object are being retrieved. ADO/WFC EquivalentPackage: com.ms.wfc.dataConstant
AdoEnums.ObjectState.CLOSED
AdoEnums.ObjectState.OPEN
AdoEnums.ObjectState.CONNECTING
AdoEnums.ObjectState.EXECUTING
AdoEnums.ObjectState.FETCHING 读一遍上面的内容可以每一次操作之前都去检查Connection.State
if Connection.State<>adStateOpen then
Connection.Open("You Connection String")
end if
在非正常关闭连接的情况下,connection.state好像不会改变值.