ASP为何不能分页

来源:百度知道 编辑:UC知道 时间:2024/09/28 17:49:08
<%
Dim fileName,postion,i
Dim pre,last,intpage,pageNo
Sub Page1()
fileName = Request.ServerVariables("script_name")
postion = InstrRev(fileName,"/")+1
fileName = Mid(fileName,postion)

pre = true
last = true
'page = trim(Request.QueryString("page"))
pageNo = Request("page")
if len(pageNo) = 0 then
intpage = 1
pre = false
else
if cint(pageNo) =< 1 then
intpage = 1
pre = false
else
if cint(pageNo) >= oRs.PageCount then
intpage = oRs.PageCount
last = false
else
intpage = cint(pageNo)
end if
end if
end if
if not oRs.eof then
oRs.AbsolutePage = intpage
end if

End sub
Sub Page()
%>
<table width="100%" height="24" align="center" cellpadding="0" cellspacing="0">
<tr>
<%if oRs.pagecount >

程序没有什么问题

这个只是一部分,谁知道你怎么调用的,再说了那变量也我头晕了...

<!--#include file = adovbs.inc -->
<HTML>
<BODY bgcolor="#ccffcc">
<%'设置每一页所要显示的记录条数,这里为9条。
Session("flag")=9
'用RecordSet对象的Open方法连接数据库
Set Session("rs")=Server.CreateObject("Adodb.recordSet")
Constr="Provider=sqloledb;Data Source=zjf;Initial Catalog=txl;User ID=sa; Password=; "
Session("rs").cursorlocation=aduseclient
sql="select * from t_student order by t_number"
'利用RecordSet对象的Open方法创建记录集
Session("rs").Open sql,Constr,adOpenkeySet,adlockreadonly,adcmdtext
%>
<%'输出表头,由于数据库中的字段名称为英文,因此,采用HTML标记输出%>
<TABLE border="1" bordercolor="#000000" cellspacing="1" cellpadding="0" align="center" >
<TR align=center valign=middle height=23>
<TD ><B>学号</B>&