首页 > 数据库 > SQL Server > 关于记录数的疑问
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语句无法用次参数返回结果集的行数来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7646028/viewspace-1015633/ ,如需转载,请注明出处,否则将追究法律责任。