为什么总是返回记录数为-1的呢?

zfcheng zfcheng 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
Dim cn As New ADODB.Connection
Dim cm As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim i As Integer

cn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\abc.mdb;Persist Security Info=False;Jet OLEDB:Database Password=abc"
cn.Open
cm.ActiveConnection = cn
cm.CommandType = adCmdText
cm.CommandText = "SELECT * FROM [abc]"
Set rs = cm.Execute
i = rs.RecordCount
MsgBox i
Set rs = Nothing
Set cm = Nothing
cn.Close
...全文
评论 9
收藏 已收藏
分享
返回顶部
zfcheng
VB基础类 7,788 成员 197,583 内容