本帖最后由 bcrun 于 2011-05-16 15:55:35 编辑

解决方案 »

  1.   

    淘汰產品打吊針,饒有興致,BUg
      

  2.   


    Private Sub Command4_Click() '删除本条记录
    If Adodc3.Recordset.RecordCount > 1 Then Adodc3.Recordset.Delete'记录表中无记录时,如果要删除,就立即退出
    If Adodc3.Recordset.RecordCount > 1 Then Adodc3.Recordset.MoveNext '删除了最后一条记录则退出
    End Sub
      

  3.   

    错了Private Sub Command4_Click() '删除本条记录
        If Adodc3.Recordset.RecordCount > 0 Then Adodc3.Recordset.Delete'记录表中无记录时,如果要删除,就立即退出
        If Adodc3.Recordset.RecordCount > 0 Then Adodc3.Recordset.MoveNext '删除了最后一条记录则退出
    End Sub
      

  4.   

    用 RecordCount 属性来判断数据量这样不慢才是怪事。
    当你调用 RecordCount 属性时,他会遍历一偏,相当于自己数一偏数据量,然后返回给你结果。
    数据量少没什么感觉,数据量大就慢很多了,通常在海量数据处理的过程中,RecordCount 属性
    是没人去读他的,要知道数据量也是通过 SQL 语句的 Count 聚合函数来查询。
    如果能避免使用数据总数,通常可以用 EOF 或 BOF 这类属性来判断数据是否到达边界,这样效率
    会高出很多。    If Adodc1.Recordset.EOF Then Exit Sub
        Adodc3.Recordset.Delete
        If Adodc1.Recordset.EOF Then Exit Sub
        Adodc3.Recordset.MoveNext
      

  5.   

    错误陷井理论上更加快Private Sub Command4_Click() '删除本条记录
        On Error Resume Next
        Adodc3.Recordset.Delete
        If Err.Number <> 0 Then Err.Clear: Exit Sub
        Adodc3.Recordset.MoveNext
        If Err.Number <> 0 Then Err.Clear
    End Sub
      

  6.   

    这样好点Private Sub Command4_Click() '删除本条记录
        On Error Resume Next
        If Adodc1.Recordset.EOF Then Exit Sub
        Adodc3.Recordset.Delete
        If Err.Number <> 0 Then Err.Clear: Exit Sub
        Adodc3.Recordset.MoveNext
        If Err.Number <> 0 Then Err.Clear
    End Sub
      

  7.   

    又要感谢SupermanKing了。请再看看http://topic.csdn.net/u/20110507/13/3c59f19c-31a4-427f-b8f7-e634d8824f4c.html