| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 521 人关注过本帖
标题:[求助]怎么分页显示不能成功呢?
只看楼主 加入收藏
wwf891
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-10-10
收藏
 问题点数:0 回复次数:4 
[求助]怎么分页显示不能成功呢?

<%@ Language=VBScript %>
<%
'判断用户是否登录
if isempty(Session("ID")) then
Response.Redirect "index.asp"
end if
'连接系统数据库
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("sd.mdb")
set rs= server.createobject("adodb.recordset")
dim i,intPage,page,pre,last定义变量
'初始化报表状态和警告状态
Warning=false
'判断当前页面状态是否是报表状态
if not IsEmpty(Request.Form("GoBack")) then
ReportLabel=False
end if
'报表的排序方式
if Request.Form("ReportOrder")="jnow" then'jnow是jipiao表里的字段名
TheOrder="按出票时间"
elseif Request.Form("ReportOrder")="num" then'num是jipiao表里的字段名
TheOrder="按机票号码"
elseif Request.Form("ReportOrder")="jdate" then'num是jipiao表里的字段名
TheOrder="按乘机日期"
elseif Request.Form("ReportOrder")="carrier" then'carrier是jipiao表里的字段名
TheOrder="按承运人"
end if
'报表是否有时间期限
if Request.Form("DateLimit")="Yes" then
StartDate=Request.Form("StartYear") & "-" & Request.Form("StartMonth") _
& "-" & Request.Form("StartDay")
EndDate= Request.Form("EndYear") & "-" & Request.Form("EndMonth") _
& "-" & Request.Form("EndDay")
TheTimeLimit="时间期限:从" & CStr(StartDate) & "到" & Cstr(EndDate) & " "
else
StartDate="1900-1-1"
EndDate="2100-1-1"
TheTimeLimit="时间期限:无 "
end if
'生成报表
if not IsEmpty(Request.Form("Send")) then'当点下生成报表时
'生成总流水帐报表
'生成正常流水帐报表
if Request.Form("reporttype") = "okjipiao" then'如果选择的是废票类型
sql="select * from jipiao where sta ='正常' and jcont='"&Session("Nameid")&"' and jnow >=#" & StartDate _
& "# and jnow<=#" & EndDate & "# order by " & Request.Form("ReportOrder")&" desc"
TheMessage = TheTimeLimit & "正常票流水帐报表按-" & TheOrder & "-排序如下"
ReportLabel=True
end if
'生成作废流水帐报表
if Request.Form("reporttype") = "voidjipiao" then'如果选择的是废票类型
sql="select * from jipiao where sta ='作废' and jcont='"&Session("Nameid")&"' and jnow >=#" & StartDate _
& "# and jnow<=#" & EndDate & "# order by " & Request.Form("ReportOrder")&" desc"
TheMessage = TheTimeLimit & "废票流水帐报表按-" & TheOrder & "-排序如下"
ReportLabel=True
end if
rs.PageSize = 2 '这里设定每页显示的记录数
rs.CursorLocation = 3
rs.open sql,conn,0,2,1
pre = true
last = true
page = trim(Request.QueryString("page"))'变量是跳转页面时的值
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
else
TheMessage = "请选择您要生成的报表类型"
ReportLabel=False
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>代理人订票查询系统</title>
<link href="info.css" rel="stylesheet" type="text/css" />
</head>
<BODY BGCOLOR="">
<FORM ACTION="chaxun1.asp" METHOD=POST>
<% if Reportlabel=False then %>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr bgcolor=white><td valign=center ><img src="image/ASPLogo3.jpg" width=800 height=123></td>
</tr></table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src="image/banner2.jpg" width="800" height="12"></td></tr></table>
<tr bgcolor=white >
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center >
<tr><td colspan=3>
<font color=white>
<P ALIGN=CENTER>查询报表&nbsp[当前用户-
<% response.write Session("Nameid") %> ]
</font></td></tr>
<tr bgcolor=white >
<td><a href=main1.asp><font color=#104DAD>返回主页</font></a></td>
<td align=center>
<% if Warning=false then %>
<font color="#104DAD" ><% response.write TheMessage %></FONT>
<% else %>
<font color=Red ><% response.write TheMessage %></font>
<% end if %>
</td>

<td align=right><a href=dapiao.asp><font color=#104DAD>返回上一级网页</font></a></td>
</tr></table>
<table width=800 border=0 bordercolor=#164DA8 align=center cellpadding=0 cellspacing=0>
<tr><td height=10 colspan=4 valign=top bgcolor=#FFFFFF>
<img src=image/banner2.jpg width=800 height=12>
</td></tr></table>
<table cellpadding=1 cellspacing=1 border=1 bordercolor=#164DA8 align=center width=800 >
<tr><td colspan=5 align=center bgcolor=#B5C7EF><font color=#164DA8>机票票状态</font></td>
</tr>
<tr><td><INPUT TYPE=radio CHECKED NAME=reporttype VALUE=thisalljipiao >正常&nbsp</td>
<td><INPUT TYPE=radio NAME=reporttype VALUE=voidjipiao>废票</td>
</tr>
</table><br>
<table cellpadding=1 cellspacing=1 border=1 bordercolor=#164DA8 align=center width=800 >
<tr><td colspan=4 align=center bgcolor=#B5C7EF><font color=#164DA8>排序方式</font></td>
</tr>
<tr><td><INPUT TYPE=radio CHECKED NAME=ReportOrder VALUE=jnow >按出票日期排序&nbsp</td>
<td><INPUT TYPE=radio NAME=ReportOrder VALUE=num >按票号排序&nbsp</td>
<td><INPUT TYPE=radio NAME=ReportOrder VALUE=date >按乘机日期排序&nbsp</td>
<td><INPUT TYPE=radio NAME=ReportOrder VALUE=carrier>按承运人排序</td>
</tr>
</table><br>
<table cellpadding=1 cellspacing=1 border=1 bordercolor=#164DA8 align=center width=800 >
<tr><td colspan=2 align=center bgcolor=#B5C7EF><font color=#164DA8>时间期限</font></td></tr>
<tr><td><INPUT TYPE=radio CHECKED NAME=DateLimit VALUE=No >无时间限制&nbsp</td><td>&nbsp</td></tr>
<tr><td><INPUT TYPE=radio NAME=DateLimit VALUE=Yes>有时间期限</td>
<td>
<table border=1 width=100%>
<tr><td>开始时间</td>
<td>
<select name="StartYear" size=1>
<OPTION VALUE="<% Response.Write Year(Date) %>">&nbsp&nbsp<% Response.Write Year(Date) %>&nbsp&nbsp</OPTION>
<%
YearCounter = 2050
Do until YearCounter <=1990
%>
<OPTION VALUE="<% Response.Write YearCounter %>">&nbsp&nbsp<% Response.Write YearCounter %>&nbsp&nbsp</OPTION>
<%
YearCounter = YearCounter-1
loop
%>
</select>年
</td>
<td>

<select name="StartMonth" size=1>
<OPTION VALUE="<% Response.Write Month(Date) %>">&nbsp&nbsp<% Response.Write Month(Date) %>&nbsp&nbsp</OPTION>
<%
MonthCounter = 12
Do until MonthCounter <=0
%>
<OPTION VALUE="<% Response.Write MonthCounter %>">&nbsp&nbsp<% Response.Write MonthCounter %>&nbsp&nbsp</OPTION>
<%
MonthCounter = MonthCounter-1
loop
%>
</select>
月</td>
<td>
<select name="StartDay" size=1>
<OPTION VALUE="<% Response.Write Day(Date) %>">&nbsp&nbsp<% Response.Write Day(Date) %>&nbsp&nbsp</OPTION>
<%
DayCounter = 31
Do until DayCounter <=0
%>
<OPTION VALUE="<% Response.Write DayCounter %>">&nbsp&nbsp<% Response.Write DayCounter %>&nbsp&nbsp</OPTION>
<%
DayCounter = DayCounter-1
loop
%>
</select>日</td></tr>
<tr><td>截至时间</td><td>
<select name="EndYear" size=1>
<OPTION VALUE="<% Response.Write Year(Date) %>">&nbsp&nbsp<% Response.Write Year(Date) %>&nbsp&nbsp</OPTION>
<%
YearCounter = 2050
Do until YearCounter <=1990
%>
<OPTION VALUE="<% Response.Write YearCounter %>">&nbsp&nbsp<% Response.Write YearCounter %>&nbsp&nbsp</OPTION>
<%
YearCounter = YearCounter-1
loop
%>
</select>年</td><td>
<select name="EndMonth" size=1>
<OPTION VALUE="<% Response.Write Month(Date) %>">&nbsp&nbsp<% Response.Write Month(Date) %>&nbsp&nbsp</OPTION>
<%
MonthCounter = 12
Do until MonthCounter <=0
%>
<OPTION VALUE="<% Response.Write MonthCounter %>">&nbsp&nbsp<% Response.Write MonthCounter %>&nbsp&nbsp</OPTION>
<%
MonthCounter = MonthCounter-1
loop
%>
</select>月</td><td>
<select name="EndDay" size=1>
<OPTION VALUE="<% Response.Write Day(Date) %>">&nbsp&nbsp<% Response.Write Day(Date) %>&nbsp&nbsp</OPTION>
<%
DayCounter = 31
Do until DayCounter <=0
%>
<OPTION VALUE="<% Response.Write DayCounter %>">&nbsp&nbsp<% Response.Write DayCounter %>&nbsp&nbsp</OPTION>
<%
DayCounter = DayCounter-1
loop
%>
</select>日</td></tr>
</table></table>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=1 WIDTH=800 align=center>
<TR VALIGN=top ALIGN=center><TD align=center >
<INPUT TYPE=submit NAME=Send VALUE=生成财务报表 style="border: 1px solid #3466BB; background-color: #B6CAEB; color: #3466BB">
</td></table>
<%
end if
%>
<br>
<% if ReportLabel=true then %>'当查询结果出现时
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr><td><font color=white><P ALIGN=CENTER><% response.write TheMessage %>
</font></td></tr>
<tr bgcolor=white ><td align=center>
<table width=800 bgcolor=#164DA8 border=0 cellspacing=1 cellpadding=2 align=center>
<td width="116"><font color=white>出票日期</font></td>
<td width="160"><font color=white>票号</font></td>
<td width="92"><font color=white>乘机日期</font></td>
<td width="55"><font color=white>出发地</font></td>
<td width="55"><font color=white>到达地</font></td>
<td width="55"><font color=white>承运人</font></td>
<td width="45"><font color=white>折扣</font></td>
<td width="72"><font color=white>机票价格</font></td>
<td width="72"><font color=white>机票总价</font></td>
<td width="60"><font color=white>代理费</font></td>
<td width="39"><font color=white>状态</font></td>
</tr>
'开始循环显示查询结果
<%
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
%>
<tr bgcolor=white >
<TD ><font face=arial>
<% Response.write RS("jnow") %>
</font></TD>
<TD ><font face=arial><% Response.write RS("num") %></font></TD>
<TD ><font face=arial><% Response.write RS("jdate") %></font></TD>
<TD ><font face=arial><% Response.write RS("jfrom") %></font></TD>
<TD ><font face=arial><% Response.write RS("jto") %></font></TD>
<TD ><font face=arial><% Response.write RS("carrier") %></font></TD>
<TD ><font face=arial><% Response.write RS("class") %></font></TD>
<TD align="right" ><font face=arial><% Response.write RS("cny") %></font></TD>
<TD align="right" ><font face=arial><% Response.write RS("tot") %></font></TD>
<TD align="right" ><font face=arial><% Response.write RS("supply") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RS("sta") %></font></TD>
</tr>
<%
sumcny=sumcny+rs("cny")
sumtot=sumtot+rs("tot")
sumsupply=sumsupply+rs("supply")
rs.movenext
next
%>
<tr bgcolor=white >
<TD ><font face=arial>合计</font></TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD align="right" ><font face=arial><% Response.write Sumcny %></font></TD>
<TD align="right" ><font face=arial><% Response.write Sumtot %></font></TD>
<TD align="right" ><font face=arial>
<% Response.write Sumsupply %></font></TD>
<TD HEIGHT=21>&nbsp;</TD>
</tr></table>
<table WIDTH=800 border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#164DA8" bgcolor=#FFFFFF>
<tr bordercolor="#164DA8">
'分页部分开始
<%if rs.pagecount > 0 then%>
<td align="left">共[<font color="#FF0000"><%=rs.RecordCount%></font>]条留言|每页显示 <font color="#FF0000"><%=rs.pagesize%></font>条记录|当前页<%=intpage%>/<%=rs.PageCount%></td>
<%else%>
<td align="left">当前页0/0</td>
<%end if%>
<td width="46%" align="right"> <a href="chaxun1.asp?page=1">首页</a>|
<%if pre then%>
<a href="chaxun1.asp?page=<%=intpage -1%>">上页</a>| <%end if%>
<%if last then%>
<a href="chaxun1.asp?page=<%=intpage +1%>">下页</a> |<%end if%>
<a href="chaxun1.asp?page=<%=rs.PageCount%>">尾页</a>|转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="chaxun1.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="chaxun1.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页</font>
</td>
</tr>
</table>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center><tr>
<td><p align=center>
<input type=submit name=GoBack value=&nbsp&nbsp重新查询报表&nbsp&nbsp style="border: 1px solid #3466BB; background-color: #FFFFFF; color: #3466BB">
</p></td></tr></table>
<%
end if
%>
</table>
</table>
</form>
<body>
</body>
</html>
页面能正常显示,根据需要能查询出需要的结果。问题是当点击分页部分的代码,如:下页,上页,首页,尾页时,出现的页面不是下一页结果,而是开始出现的查询条件。有人说是查询条件没有传递下去,但这个怎么传递呢?希望能得到大家的帮助

搜索更多相关主题的帖子: Microsoft 数据库 状态 Set 
2006-10-10 13:35
渚薰
Rank: 6Rank: 6
等 级:贵宾
威 望:22
帖 子:1132
专家分:0
注 册:2006-8-6
收藏
得分:0 
chaxun1.asp?page=1&.......

在url里同样添加查询条件,之前从表单传过来多少条件,就添加多少
同时,页面中Request.Form("...")改为Request(""),可以同时适应表单和url参数的情况

个人ajax技术专题站: " target="_blank">http://www. 我不会闲你烦,只会闲你不够烦!
2006-10-10 13:43
jimn2000
Rank: 2
等 级:新手上路
威 望:3
帖 子:274
专家分:0
注 册:2006-4-3
收藏
得分:0 
给你一个分页的自己对着看看吧

http://www.helpsos.cn/dnwzck.asp?c=46


欢迎大家访问我的网站 www. 域名代理网站 web.
2006-10-10 20:56
wwf891
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-10-10
收藏
得分:0 
斑竹能详细说说吗?我都搞得头大了,按照JIMN2000的连接去看,结果把自己的代码反而搞得更乱七八糟了。麻烦渚薰斑竹详细说说啊,不胜感谢
2006-10-10 22:32
wwf891
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2006-10-10
收藏
得分:0 
<%@ Language=VBScript %>
<%
'判断用户是否登录
if isempty(Session("ID")) then
Response.Redirect "index.asp"
end if
'连接系统数据库
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("sd.mdb")
dim i,intPage,page,pre,last,st'定义变量
'初始化报表状态和警告状态
Warning=false
'判断当前页面状态是否是报表状态
if not IsEmpty(Request.Form("GoBack")) then
Response.Redirect "9.asp"
end if
'报表的排序方式
if Request.Form("ReportOrder")="jnow" then'jnow是jipiao表里的字段名
TheOrder="按出票时间"
elseif Request.Form("ReportOrder")="num" then'num是jipiao表里的字段名
TheOrder="按机票号码"
elseif Request.Form("ReportOrder")="jdate" then'num是jipiao表里的字段名
TheOrder="按乘机日期"
elseif Request.Form("ReportOrder")="carrier" then'carrier是jipiao表里的字段名
TheOrder="按承运人"
end if
'报表是否有时间期限
if Request.Form("DateLimit")="Yes" then
StartDate=Request.Form("StartYear") & "-" & Request.Form("StartMonth") _
& "-" & Request.Form("StartDay")
EndDate= Request.Form("EndYear") & "-" & Request.Form("EndMonth") _
& "-" & Request.Form("EndDay")
TheTimeLimit="时间期限:从" & CStr(StartDate) & "到" & Cstr(EndDate) & " "
else
StartDate="1900-1-1"
EndDate="2100-1-1"
TheTimeLimit="时间期限:无 "
end if
'生成报表
if not IsEmpty(Request("Send")) then'当点下生成报表时
select case Request("reporttype")
'生成总流水帐报表
case "thisalljipiao" '如果选择的类型是全部
sql="select * from jipiao where jcont='"&Session("Nameid")&"' and jnow >=#" & StartDate _
& "# and jnow<=#" & EndDate & "# order by " & Request.Form("ReportOrder")&" desc"'产生选择条件的合集。nameid是定义好了的
response.write sql
TheMessage = TheTimeLimit & "总流水帐报表按-" & TheOrder & "-排序如下"
ReportLabel=True
'生成正常流水帐报表
case "okjipiao" '如果选择的是废票类型
sql="select * from jipiao where sta ='正常' and jcont='"&Session("Nameid")&"' and jnow >=#" & StartDate _
& "# and jnow<=#" & EndDate & "# order by " & Request.Form("ReportOrder")&" desc"
TheMessage = TheTimeLimit & "正常票流水帐报表按-" & TheOrder & "-排序如下"
ReportLabel=True
'生成退票流水帐报表
case "rejipiao" '如果选择的是废票类型
sql="select * from jipiao where sta ='退票' and jcont='"&Session("Nameid")&"' and jnow >=#" & StartDate _
& "# and jnow<=#" & EndDate & "# order by " & Request.Form("ReportOrder")&" desc"
TheMessage = TheTimeLimit & "退票流水帐报表按-" & TheOrder & "-排序如下"
ReportLabel=True
'生成作废流水帐报表
case "voidjipiao" '如果选择的是废票类型
sql="select * from jipiao where sta ='VOID' and jcont='"&Session("Nameid")&"' and jnow >=#" & StartDate _
& "# and jnow<=#" & EndDate & "# order by " & Request.Form("ReportOrder")&" desc"
TheMessage = TheTimeLimit & "废票流水帐报表按-" & TheOrder & "-排序如下"
ReportLabel=True
end select
set rs= server.createobject("adodb.recordset")
rs.PageSize = 2 '这里设定每页显示的记录数
rs.CursorLocation = 3
rs.open sql,conn,0,2,1
pre = true
last = true
page = trim(Request.QueryString("page"))'变量是跳转页面时的值
st = trim(Request.QueryString("sta"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
else
TheMessage = "请选择您要生成的报表类型"
ReportLabel=False
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>查询系统</title>
<link href="info.css" rel="stylesheet" type="text/css" />
</head>
<BODY BGCOLOR="">
<FORM ACTION="10.asp" METHOD=POST>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr bgcolor=white><td valign=center ><img src="image/ASPLogo3.jpg" width=800 height=123></td>
</tr></table>
<table width="800" border="0" bordercolor="#164DA8" align="center" cellpadding="0" cellspacing="0">
<tr><td height="13"><img src="image/banner2.jpg" width="800" height="12"></td></tr></table>
<tr bgcolor=white >
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center >
<tr><td colspan=3>
<font color=white>
<P ALIGN=CENTER>查询系统->查询报表&nbsp[当前用户-
<% response.write Session("Nameid") %> ]</font></td></tr>
<tr bgcolor=white >
<td align=center>
<% if Warning=false then %>
<font color="#104DAD" ><% response.write TheMessage %></FONT>
<% else %>
<font color=Red ><% response.write TheMessage %></font>
<% end if %></td>
</tr></table>
<table width=800 border=0 bordercolor=#164DA8 align=center cellpadding=0 cellspacing=0>
<tr><td height=10 colspan=4 valign=top bgcolor=#FFFFFF>
<img src=image/banner2.jpg width=800 height=12>
</td></tr></table>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center>
<tr bgcolor=white ><td align=center><table width=800 bgcolor=#164DA8 border=0 cellspacing=1 cellpadding=2 align=center>
<td width="116"><font color=white>出票日期</font></td>
<td width="160"><font color=white>票号</font></td>
<td width="92"><font color=white>乘机日期</font></td>
<td width="55"><font color=white>出发地</font></td>
<td width="55"><font color=white>到达地</font></td>
<td width="55"><font color=white>承运人</font></td>
<td width="45"><font color=white>折扣</font></td>
<td width="72"><font color=white>机票价格</font></td>
<td width="72"><font color=white>机票总价</font></td>
<td width="60"><font color=white>代理费</font></td>
<td width="39"><font color=white>状态</font></td>
</tr>
<%
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
%>
<tr bgcolor=white >
<TD ><font face=arial>
<% Response.write RS("jnow") %>
</font></TD>
<TD ><font face=arial><% Response.write RS("num") %></font></TD>
<TD ><font face=arial><% Response.write RS("jdate") %></font></TD>
<TD ><font face=arial><% Response.write RS("jfrom") %></font></TD>
<TD ><font face=arial><% Response.write RS("jto") %></font></TD>
<TD ><font face=arial><% Response.write RS("carrier") %></font></TD>
<TD ><font face=arial><% Response.write RS("class") %></font></TD>
<TD align="right" ><font face=arial><% Response.write RS("cny") %></font></TD>
<TD align="right" ><font face=arial><% Response.write RS("tot") %></font></TD>
<TD align="right" ><font face=arial><% Response.write RS("supply") %></font></TD>
<TD HEIGHT=21><font face=arial><% Response.write RS("sta") %></font></TD>
</tr>
<%
sumcny=sumcny+rs("cny")
sumtot=sumtot+rs("tot")
sumsupply=sumsupply+rs("supply")
rs.movenext
next
%>
<tr bgcolor=white >
<TD ><font face=arial>合计</font></TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD >&nbsp;</TD>
<TD align="right" ><font face=arial><% Response.write Sumcny %></font></TD>
<TD align="right" ><font face=arial><% Response.write Sumtot %></font></TD>
<TD align="right" ><font face=arial>
<% Response.write Sumsupply %></font></TD>
<TD HEIGHT=21>&nbsp;</TD>
</tr></table>
<table WIDTH=800 border=0 align=center cellpadding=2 cellspacing=1 bordercolor="#164DA8" bgcolor=#FFFFFF>
<tr bordercolor="#164DA8">
<%if rs.pagecount > 0 then%>
<td align="left">共[<font color="#FF0000"><%=rs.RecordCount%></font>]条留言|每页显示 <font color="#FF0000"><%=rs.pagesize%></font>条记录|当前页<%=intpage%>/<%=rs.PageCount%></td>
<td width="46%" align="right"> <a href="10.asp?page=1">首页</a>|
<%if pre then%>
<a href="10.asp?page=<%=intpage -1%>">上页</a>| <%end if%>
<%if last then%>
<a href="10.asp?page=<%=intpage +1%>">下页</a> |<%end if%>
<a href="10.asp?page=<%=rs.PageCount%>">尾页</a>|转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="10.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="10.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页</font></td>
<%else%>
<td align="left">当前页0/0</td>
<%end if
%>
</tr>
</table>
<table width=800 border=0 bgcolor=#164DA8 cellspacing=1 cellpadding=2 align=center><tr>
<td><p align=center>
<input type=submit name=GoBack value=&nbsp&nbsp重新查询报表&nbsp&nbsp style="border: 1px solid #3466BB; background-color: #FFFFFF; color: #3466BB">
</p></td></tr></table>
</table>
</table>
</form>
<body>
</body>
</html>
改动了一下,这个页面只显示结果。问题还是出在分页部分,现在出现的问题是:Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: ''

/10.asp,行 147
看了下147行,代码为
for i=1 to rs.PageSize
这下又该怎么办呢?
2006-10-10 23:55
快速回复:[求助]怎么分页显示不能成功呢?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030726 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved