首页 > 代码库 > vb6异步ADO操作

vb6异步ADO操作

Private withevents M_Conn as adodb.connectionPrivate CmdFinished as booleansub somesub    AdoCmd.Execute , , adAsyncExecute    do while not CmdFinished         doevents    loopend subChange the CmdFinished value on the connection_ExecuteComplete event and connection_WillExecutePrivate Sub M_Conn_ExecuteComplete(ByVal RecordsAffected As Long, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pCommand As ADODB.Command, ByVal pRecordset As ADODB.Recordset, ByVal pConnection As ADODB.Connection)    CmdFinished = TrueEnd SubPrivate Sub M_Conn_WillExecute(Source As String, CursorType As ADODB.CursorTypeEnum, LockType As ADODB.LockTypeEnum, Options As Long, adStatus As ADODB.EventStatusEnum,ByVal pCommand As ADODB.Command, ByVal pRecordset As ADODB.Recordset, ByVal pConnection As ADODB.Connection)    CmdFinished = FalseEnd Sub