日期:2014-05-17  浏览次数:20987 次

分页输出
数据库表为test表中有十条记录
为何输出的结果都为-1,-1 ????
VBScript code
'测试读取MySql数据库的内容
const adopenstatic=3
const adlockpessimistic=2
strconnection="driver={mysql odbc 5.1 driver};database=test;server=localhost;uid=root;password=dubu"
'无需配置dsn
set conn = server.createobject("adodb.connection") 
conn.open strconnection
response.write "连接成功"&"<p>"
set rconn=server.CreateObject("adodb.recordset")
rconn.open "test",conn,adopenstatic,adlockpessimistic
rconn.pagesize=5
response.Write "记录总数"&rconn.recordcount
response.Write "总页数"&rconn.pagecount


------解决方案--------------------
rconn.open 前加 rconn.cursorLocation = 3