VB如何获取access数据库中某个表的记录总数?
我的代码是以下,但却得到错误内容为:operation is not allow when the object is open.并标语句“rs.CursorLocation = adUseClient”为黄色,请问哪里的错误?如何改正?谢谢前辈指点。Private sub
Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim s As Long
db.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\jenny\Desktop\liuhua-project\运行程序\db-qestionnare.accdb"
rs.Open "人员信息", db, 2, 2
rs.CursorLocation = adUseClient
s = rs.RecordCount - 1
MsgBox (s)
rs.Close
end sub