首先你的数据库要有可以唯一排序的字段,比如ID或者编号之类。
假定你用id进行唯一排序,那么提取第100到第200条记录的语句就是:
select top 100 * from table where id>(select max(id) from (select top 100 id from table order by id asc) as tblTmp) order by id asc
假定你每页显示数量为Point,当前页码为Page,那么显示该页所有记录的SQL语句应该是:
sql = "select top " & Point & " * from table where id>(select max(id) from (select top " & (Page - 1) * Point & " id from table order by id asc) as tblTmp) order by id asc