<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>搜索结果分页</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style></head>
<%
'********************************************连接SQL SERVER数据库语句 ********************************
Dim DBUserID,DBPassWord,DBName,DBIP
DBUserID="sa" '数据库登陆名
DBPassWord="admin" '数据库密码
DBName="asp" '数据库名称
DBIP="LocalHost" '数据库所在地址,如果是本地数据库则为:(local)
Set Conn=Server.CreateObject("Adodb.Connection")
sqlcon = "Provider=SQLOLEDB.1;Data Source="&DBIP&";DATABASE="&DBName&";UID="&DBUserID&";PWD="&DBPassWord&";"
Conn.Open sqlcon
%>
<%
Dim Book_Name,Book_Author,BClass_ID,sSql
Dim pgsize,pgnm,page
Book_Name=Request.Form("Book_Name")
Book_Author=Request.Form("Book_Author")
BClass_ID=Request.Form("BClass_ID")
Set rs=Server.CreateObject("ADODB.RecordSet")
page=Request.QueryString("page")
pgsize=3
sSql="SELECT * FROM Books WHERE BClass_ID='"&BClass_ID&"' AND Book_Author LIKE '%"&Book_Author&"%' AND Book_Name LIKE '%"&Book_Name&"%'"
rs.open sSql,sqlcon,1,3
%>
<%
rs.PageSize=pgsize
pgnm=rs.PageCount
if page="" or Clng(page)<1 Then
page=1
end if
if Clng(page)>pgnm Then
page=pgnm
end if
if pgnm>0 Then
rs.AbsolutePage=page
end if
Count=0
%>
<body>
<table border="1" cellpadding="0" cellspacing="0" width="605" heigth="25" >
<tr>
<td width="105">图片</td>
<td width="200">书名</td>
<td width="100">作者</td>
<td width="100">定价</td>
<td width="100">会员价</td>
</tr>
</table>
<% while not rs.eof and Count<rs.PageSize %>
<table border="1" cellpadding="0" cellspacing="0" width="605" height="25">
<tr>
<td width="105"><img src="../BookImage/<%=rs("Book_Pic")%>" width="105" height="90"></td>
<td width="200"><%=rs("Book_Name")%></td>
<td width="100"><%=rs("Book_Author")%></td>
<td width="100"><%=rs("Book_OrigPrice")%></td>
<td width="100"><%=rs("Book_SellPrice")%></td>
</tr>
<tr>
<% Count=Count+1 %>
<% rs.movenext %>
<% wend %>
<td width="100%" colspan="5">
<a href="search_fenye_1.asp?Book_Name<%=Book_Name%>&Book_Author<%=Book_Author%>&BClass_ID<%=BClass_ID%>&page=1">第一页</a>
<a href="search_fenye_1.asp?Book_Name<%=Book_Name%>&Book_Author<%=Book_Author%>&BClass_ID<%=BClass_ID%>&page=<%=pgnm%>">最后一页</a>
<a href="search_fenye_1.asp?Book_Name<%=Book_Name%>&Book_Author<%=Book_Author%>&BClass_ID<%=BClass_ID%>&page=<%=page+1%>">下一页</a>
<a href="search_fenye_1.asp?Book_Name<%=Book_Name%>&Book_Author<%=Book_Author%>&BClass_ID<%=BClass_ID%>&page=<%=page-1%>">上一页</a>
</td>
</tr>
</table>
<% rs.close %>
<% Conn.close %>
</body>
</html>
上面的程序,当首次搜索时能正常显示搜索结果,但当点击"下一页"时就什么搜索结果也没有,这是参数没有传过去,
请问一下如何才能传递参数(当点击"下一页"或"上一页"或"第一页"或"最后一页"),上面设置的传递参数的格式为什么不可以
麻烦各位,谢谢!!