有20条记录,应该有两页,但我点击“Next”时,第二页却不能显示记录!!

lilicsdn 2003-09-15 08:55:23
<!-- #Include File="../inc/dsn.asp" -->
<!-- #Include File="../inc/judge.inc" -->
<%
' bookings_date1=request("syear") + "-" + request("smonth") + "-" + request("sday")

' bookings_date2=request("syear2") + "-" + request("smonth2") + "-" + request("sday2")

'------------------------------------------

qq="select * from bookings where bookings_date>='"&bookings_date1&"' and " &_
"bookings_date<='"&bookings_date2&"' order by confirm_number desc"

rs.Open qq,conn,1,1,1
if not(rs.eof and rs.bof) then
desurl="bookings_list.asp"
pgsz=10
rs.pagesize=Cint(pgsz)
total=rs.pagecount
PageNo=request("pageno")
if pageno="" then pageno=1
scrollAction=request("scrollaction")
if scrollaction="first" then pageno=1
if scrollaction="pre" then pageno=pageno-1
if scrollaction="next" then pageno=pageno+1
if scrollaction="last" then pageno=total
if pageno<1 then pageno=1
if request("inputpage")<>"" then pageno=cint(request("inputpage"))
n=1
rs.absolutepage=pageno
position=rs.pagesize*pageno
pagebegin=position-rs.pagesize+1
if position<rs.recordcount then
pageend=position
else
pageend=rs.recordcount
end if
end if
session("bookings_date1")=bookings_date1
session("bookings_date2")=bookings_date2%>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Hotel Bookings</title>
<!-- #Include File="../inc/style.css" -->
<%if not(rs.eof and rs.bof) then %>
<%end if%></head>

<body>


<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="774" height="526">
<tr>
<td width="781" height="18" colspan="2" valign="bottom">
<!-- #Include File="../inc/zhaopin_top.inc" -->
</td>
</tr>
<center>
<tr>
<td width="167" height="397" valign="top">
<!-- #Include File="../inc/zhaopin_left.inc" -->
</td>
</center>
<td width="614" height="397" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="445">
<tr>
<td width="100%" height="25" class="n1">
<p align="right">File Path:Client->Hotel Bookings->Bookings Management</td>
</tr>
<center>
<tr>
<td width="100%" height="27" class="n1">
<p align="center"><font face="Georgia" size="4"> </font></td>
</tr>
<tr>
<td width="100%" height="393" valign="top" align="center">
<% if rs.recordcount=0 then %>

<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber2" height="36" bgcolor="#EAEAD5" bordercolor="#000000">
<tr>
<td width="100%" height="36" align="center"><font face="Georgia" style="font-size: 8pt">
  Sorry,  No results were found!  </font><a title="Return" href="javascript:{history.back(-1)}">Return</a><br>
  </td>
</tr>
</table><br>
<%else%>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber2" height="36" bgcolor="#EAEAD5" bordercolor="#000000">
<tr>
<td width="100%" height="36" align="center"><font face="Georgia" style="font-size: 8pt">
 </font>If you wish to view guest's details, click the <u>Detail</u> links.<br>
  </td>
</tr>
</table><br>

<%end if%>
<table border=1 borderColor=#DB8933 cellSpacing=0 width="614" class="n1" height="72" style="border-collapse: collapse">
<tr>
<td width="582" align="center" bgcolor="#DB8933" height="40" colspan="10">
<b><font face="Georgia" size="4" color="#EAEAD5">Guest Bookings Detail Records</font></b></td>
</tr>
<tr>
<td width="70" align="center" bgcolor="#EAEAD5" height="25">Confirmation Number</td>
<td width="60" align="center" bgcolor="#EAEAD5" height="25">First Name</td>
<td width="60" align="center" bgcolor="#EAEAD5" height="25">Last Name</td>
<td width="60" align="center" bgcolor="#EAEAD5" height="25">City</td>
<td width="56" align="center" bgcolor="#EAEAD5" height="25">Country</td>
<td width="65" align="center" bgcolor="#EAEAD5" height="25">Check-In Date</td>
<td width="65" align="center" bgcolor="#EAEAD5" height="25">Check-Out Date</td>
<td width="66" align="center" bgcolor="#EAEAD5" height="25">Room Category</td>
<td width="40" align="center" bgcolor="#EAEAD5" height="25">Room Quantity</td>

</tr><%
do while not (rs is nothing)
rowcount=rs.pagesize
do while not rs.eof and rowcount>0
if n=1 then
colortf="FfffFF"
else
colortf="FFFBF7"
end if
n=1-n
%><tr>
<td width="70" align="center" height="8" bgcolor="#EDEDED"><%=rs("confirm_number")%></td>
<td width="60" align="center" height="8" bgcolor="#EDEDED"><%=rs("first_name")%></td>
<td width="60" align="center" height="8" bgcolor="#EDEDED"><%=rs("last_name")%></td>
<td width="60" align="center" height="8" bgcolor="#EDEDED"><%=rs("city")%></td>
<td width="56" align="center" height="8" bgcolor="#EDEDED"><%=rs("country")%></td>
<td width="65" align="center" height="8" bgcolor="#EDEDED"><%=rs("check_in_date")%></td>
<td width="66" align="center" height="8" bgcolor="#EDEDED"><%=rs("check_out_date")%></td>
<td width="66" align="center" height="8" bgcolor="#EDEDED"><%=rs("room_category")%></td>
<td width="40" align="center" height="8" bgcolor="#EDEDED"><%=rs("room_quantity")%></td>

</center>

</tr><%
rowcount=rowcount-1
rs.movenext
loop
set rs =rs.nextrecordset
loop
conn.close
set rs=nothing
set conn=nothing
%>
<form name="search" action="<%=desurl%>?sortby=<%=request("sortby")%>" method="post">
<tr>
<td align="middle" class="n2" height="20" colspan="10" bgcolor="#EAEAD5" width="561"><font color="#808080"><%if pageno>1 then%>
<a href="<%=desurl%>?scrollaction=first&pageno=<% =pageno%>"><font color="000099">First</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=pre&pageno=<% =pageno%>"><font color="000099">Previous</font></a>
<%else
response.write "<font color='darkgray'>First</font>"
response.write " "
response.write "<font color='darkgray'>Previous</font>"
end if
response.write " "
if rowcount=0 and pageno<>total then%>
<a href="<%=desurl%>?scrollaction=next&pageno=<% =pageno%>"><font color="000099">Next</font></a>
<%response.write " "%>
<a href="<%=desurl%>?scrollaction=last&pageno=<% =pageno%>"><font color="000099">Last</font></a>
<%else
response.write "<font color='darkgray'>Next</font>"
response.write " "
response.write "<font color='darkgray'>Last</font>"
end if
%></font>      <%=pageno%>/<%=total%>Page         
Goto page:<input type="text" name="inputpage" size="6" style="height: 20; width: 28" value="1" maxlen="3">Page <input class="sub" onclick="validate()"
style="font-family: Impact" type="button" value=" GO " id=button1 name=button></td>
</tr></form>
</table>
<%
set rs=nothing
set rs2=nothing
%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="781" height="37" valign="middle" colspan="2"><p align="center"><!-- #Include File="../inc/bottom.inc" --></td>
</tr>
</table></div></body></html>
有20条记录,应该有两页,但我点击“Next”时,第二页却不能显示记录!!
...全文
83 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lilicsdn 2003-09-15
  • 打赏
  • 举报
回复
if request("qq")<>"" then
bookings_date1=request("bookings_date1")
bookings_date2=request("bookings_date2")
'qq=request("qq")
else
bookings_date1=request("syear") + "-" + request("smonth") + "-" + request("sday")


bookings_date2=request("syear2") + "-" + request("smonth2") + "-" + request("sday2")
end if

qq="select * from bookings where bookings_date>='"&bookings_date1&"' and " &_
"bookings_date<='"&bookings_date2&"' order by confirm_number desc"


问题解决了,谢谢。。。。61(儿童节快乐)
lilicsdn 2003-09-15
  • 打赏
  • 举报
回复
if request("qq")<>"" then
bookings_date1=request("bookings_date1")
bookings_date2=request("bookings_date2")
qq=request("qq")
else
bookings_date1=request("syear") + "-" + request("smonth") + "-" + request("sday")
bookings_date2=request("syear2") + "-" + request("smonth2") + "-" + request("sday2")

qq="select * from bookings where bookings_date>='"&bookings_date1&"' and " &_
"bookings_date<='"&bookings_date2&"' order by confirm_number desc"
end if

.....
<a href="<%=desurl%>?scrollaction=next&pageno=<% =pageno%>&qq=<%=qq%>&bookings_date1=<%=bookings_date1%>&bookings_date2=<%=bookings_date2%>"><font color="000099">Next</font></a>

呵,第二页还是空表,:(
55555。。。。
61 2003-09-15
  • 打赏
  • 举报
回复
if request("qq")<>"" then
qq=request("qq")
else
qq="select * from bookings where bookings_date>='"&bookings_date1&"' and " &_
"bookings_date<='"&bookings_date2&"' order by confirm_number desc"
end if

......

<a href="<%=desurl%>?scrollaction=next&pageno=<% =pageno%>&qq=<%=qq%>"><font color="000099">Next</font></a>
yzwxjun 2003-09-15
  • 打赏
  • 举报
回复
试试楼上的再说吧,
lilicsdn 2003-09-15
  • 打赏
  • 举报
回复
bookings_date1=request("syear") + "-" + request("smonth") + "-" + request("sday")

bookings_date2=request("syear2") + "-" + request("smonth2") + "-" + request("sday2")
去掉引号。

呵呵,第二页只显示一个空表。
lilicsdn 2003-09-15
  • 打赏
  • 举报
回复
贴的长了一点,table里的东东可跳过,不看, 请指教!

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧