If Rst.State = adStateOpen Then 连接上

解决方案 »

  1.   

    Specifies whether an object is open or closed, connecting to a data source, executing a command, or retrieving data.
    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. 
      

  2.   

    connection.Open ConnectionString, UserID, Password, OptionsOptions - Optional. A ConnectOptionEnum value that determines whether this method should return after (synchronously) or before (asynchronously) the connection is established.ConnectOptionEnum - 
    Specifies whether the Open method of a Connection object should return after (synchronously) or before (asynchronously) the connection is established.adAsyncConnect       16 Opens the connection asynchronously. The ConnectComplete event may be used to determine when the connection is available. 
    adConnectUnspecified -1 Default. Opens the connection synchronously.