如何知道SQL查询后查询到的数据个数!!!!!
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\sjk.mdb;Persist Security Info=False"
cn.Open
Set rs = New ADODB.Recordset
Dim str As String
If Text1.Text = "" Then MsgBox "用户简称不能为空", vbExclamation + vbOKOnly, "提示": Text1.SetFocus: Exit Sub
If Text2.Text = "" Then MsgBox "用户姓名不能为空", vbExclamation + vbOKOnly, "提示": Text2.SetFocus: Exit Sub
If Text5.Text = "" Then MsgBox "用户密码不能为空", vbExclamation + vbOKOnly, "提示": Text5.SetFocus: Exit Sub
If Combo1.Text <> "标准" And Combo1.Text <> "管理" Then MsgBox "权限应为“标准”或“管理”!", vbExclamation + vbOKOnly, "提示": Exit Sub
str = "select * from 用户 where 简称='" & Text1.Text & "'"
rs.Open str, cn
If rs.RecordCount <> 0 Then
rs.Close
str = "select * from 用户"
rs.Open str, cn, 1, 3
rs.MoveFirst
rs.AddNew
Else
MsgBox "存在相同的用户简称", vbExclamation + vbOKOnly, "提示"
Exit Sub
End If
用recordcount说不行,出错!!!,那用什么呢?