【发布时间】:2011-02-16 18:22:18
【问题描述】:
我在 asp classic 中的代码,做一个 mssql 数据库查询:
rs.pagesize = 1000 ' this should enable paging
rs.maxrecords = 0 ' 0 = unlimited maxrecords
response.write "hello world 1<br>"
rs.open strSql, conn
response.write "hello world 2<br>"
当返回的行数少于 1000 时,我的输出很好。超过 1000 行,我没有得到“hello world 2”。
我认为设置 pagesize 会设置分页,因此无论有多少行都可以返回所有行。如果不设置 pagesize,则不启用分页,限制为 1000 行。但是,我的页面表现得好像 pagesize 根本不起作用。
请指教。
【问题讨论】:
-
一次对数据库结果 N 条记录进行分页:4guysfromrolla.com/webtech/121298-1.shtml
-
如果你没有到达“hello world 2”那一行,这意味着你得到了错误,它与分页无关。从您的代码中删除任何
on error resume next行,再次运行,您很可能会看到错误消息。
标签: asp-classic ado recordset