If mrc.EOF = True or -1 Then

解决方案 »

  1.   

    Dim senSQL As String
     Dim MsgText As String
     Dim cnn As ADODB.Connection
     Dim mrc As ADODB.Recordset
     Dim timeK As String cnn = New ADODB.Connection
     mrc = New ADODB.RecordSet
     cnn.Open .....  For i = 1 To 4
       timeK = 3 & "." & CStr(i)
       
       senSQL = "select * from table_dayv where ..."
       Set mrc = cnn.ExecuteSQL(senSQL, MsgText)
       If mrc.EOF = True Then
        senSQL = "insert into table_dayv(时间分类,总时间) ..."
        Set mrc = ExecuteSQL(senSQL, MsgText)
       End If   senSQL = "insert into table_dayv(时间分类,总时间) ..."
       set mrc = cnn.ExecuteSQL(senSQL,MsgText)
     Next i