怎么统计vb中ado控件查询的结果
我编了一个车辆查询系统,用了vb60中的adodc控件和datagrid控件,查询结果可以显示出来一切正常。但是我想统计一下一共查询了多少辆车,不知道该如何实现这个功能。请教各位高手给出详细的方法和代码。程序的全部代码和运行结果图如下:
Private Sub Command1_Click()'这是"查询"按钮
a = Format(Date, "mm-dd")
SQL = "select car_num,date from baoxian where date ='& a & '"
Adodc1.C
= adCmdText
Adodc1.RecordSource = SQL
Adodc1.Refresh
DataGrid1.Refresh
End Sub
Private Sub Command2_Click()'这是"按车号查询"的按钮
SQL = "select car_num,date from baoxian where car_num = '" & Text4.Text & " '"
Adodc1.C
= adCmdText
Adodc1.RecordSource = SQL
Adodc1.Refresh
DataGrid1.Refresh
End Sub
Private Sub Command3_Click()'这是"按月份查询"的按钮
SQL = "select car_num,date from baoxian where date like '" & Text5.Text & "-%' order by date"
Adodc1.C
= adCmdText
Adodc1.RecordSource = SQL
Adodc1.Refresh
DataGrid1.Refresh
End Sub
Private Sub Command4_Click()'这是"退出"的按钮
End
End Sub