请问如何统计
已查找到的记录数?
Private Sub Command6_Click()
   If Adodc5.Recordset.RecordCount > 0 Then '若记录非空
      Adodc5.Recordset.Find " " & Trim(Combo2.Text) & " like '*" & Text10.Text & "*' "
      Label27.Visible = True
     Label27.Caption = "记录总数为 " & Adodc5.Recordset.RecordCount & " 条!其中符合条件的记录数是(~~~~~)"
        If Adodc5.Recordset.EOF = True Then
     MsgBox "对不起,没找到您要查找的关键字,请确认输入无误后再继续查找!", vbExclamation, "提示"
     Adodc5.Refresh
   End If
  End IfEnd Sub请问如何改动下?

解决方案 »

  1.   

    Select Count(*) from 表名
    取出来的值就是记录数啊。
      

  2.   

    Adodc5.Recordset.Find " " & Trim(Combo2.Text) & " like '*" & Text10.Text & "*' "
    上面的语句只是 让指针移动到符合某个条件的记录如果是想查找符合条件的记录数,需要改一下:
    Adodc5.DataSource="select * from 表 where " & Trim(Combo2.Text) & " like '*" & Text10.Text & "*' "MsgBox adodc5.Recordset.RecordCount