RecordCount=-1问题

通常人们使用以下两种方法来执行SQL语句:

Set Rs=Conn.Execute(SqlStr)

Set Rs=Server.CreateObject(“ADODB.RecordSet“)

Rs.Open SqlStr,Conn,CursorType,LockType

(RecordSet对象方法请看这里)

由于默认的记录集游标是服务器游标,

Rs.CursorLocation = adUseServer

所以返回Rs.RecordCount=-1,

应该把服务器游标改为客户端游标,

Rs.CursorLocation = adUseClient

Rs.Open SqlStr,Conn,CursorType,LockType

rs.cursortype

光标类型 recordcount 属性

猜你喜欢

转载自afeix.iteye.com/blog/1853258
今日推荐