关于记录数的疑问

来源:这里教程网 时间:2026-03-02 10:00:20 作者:

recordset.recordcount返回为-1的解决方法为:首先:打开连接前,设置游标为客户游标,即cnn.CursorLocation = adUseClient,然后,打开recordset时,使用adOpenKeyset或adOpenStatic。

使用connection.Execute CommandText, RecordsAffected, Options

时,可以用RecordsAffected返回操作所影响的记录数目,不过好像只对insert、update、delete等语句有效,select语句无法用次参数返回结果集的行数[@more@]

recordset.recordcount返回为-1的解决方法为:首先:打开连接前,设置游标为客户游标,即cnn.CursorLocation = adUseClient,然后,打开recordset时,使用adOpenKeyset或adOpenStatic。

使用connection.Execute CommandText, RecordsAffected, Options

时,可以用RecordsAffected返回操作所影响的记录数目,不过好像只对insert、update、delete等语句有效,select语句无法用次参数返回结果集的行数

相关推荐