跪求高手解决!!!!就是分页问题!!!我传参数了,为什么还是不行?????为什么????

anquan007 2010-07-16 09:55:03
<!--#include file="..\inc\conn.asp"-->
<!--#include file="..\inc\SessionCheck.asp"-->
<%
Call DBConnBegin()
dim sc,scontent
sc=trim(request("sc"))
scontent=trim(request("scontent"))
sSql="select * from original "
select case sc
case "0"
sSql=sSql
case "1"
sSql=sSql&" where IP like '%"&scontent&"%'"
case "2"
sSql=sSql&" where VLAN like '%"&scontent&"%'"
case "3"
sSql=sSql&" where Port like '%"&scontent&"%'"
end select
sSql=sSql&" order by id "
oRs.open sSql,oConn,1,1
%>

<html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>信息查询</title>
<link rel="stylesheet" href="..\inc\style.css" type="text/css">
</head>

<body topmargin="0" leftmargin="0">
<!--#include file="..\CommonFile\pagehead.asp"-->
<table width="738" border="0"><tr><td align=left>
<table width="736" height="35" cellspacing="0" cellpadding="0">
<td background="../images/top_1.jpg">  <a href="listtwo.asp" class="link">循环数据列表</a>
| <a href="searchtwo.asp" class="link">数据查询</a></table>
<div align="center">


<center><form method="POST" action="searchtwo1.asp">
<table border="0" width="700" cellspacing="0" cellpadding="0">
<tr><td align="right">选择查询条件:<select size="1" name="sc">
<option value="0" selected>全部</option>
<option value="1">Ip地址</option>
<option value="2">Vlan</option>
<option value="3">Port</option>
</select> 输入查询内容:<input type="text" name="sContent" size="20"> <input type="submit" value="查询" name="B1"></td></tr></table></form>
<%
if Not(oRs.bof and oRs.eof) then'判别数据表中是否为空记录
dim NumRecord,NumPage,NoncePage,i
NumRecord=oRs.recordcount
oRs.pagesize=100
NumPage=oRs.Pagecount
if request("page")=empty then
NoncePage=1
else
if Cint(request("page"))<1 then
NoncePage=1
else
NoncePage=request("page")
end if
if Cint(Trim(request("page")))>Cint(NumPage) then NoncePage=NumPage
end if
else
NumRecord=0
NumPage=0
NoncePage=0
end if
%>
<table border="1" width="700" bordercolorlight="#000000" cellspacing="0" cellpadding="5" bordercolordark="#FFFFFF">
<tr>
<td width="150" bgcolor="#EBE9FE" align="center">IP地址</td>
<td width="200" bgcolor="#EBE9FE" align="center">MAC地址</td>
<td width="65" bgcolor="#EBE9FE" align="center">VLAN</td>
<td width="110" bgcolor="#EBE9FE" align="center">Port</td>
<td width="110" bgcolor="#EBE9FE" align="center">Aging</td>
<td width="110" bgcolor="#EBE9FE" align="center">Type</td>


</tr>
<%if Not(oRs.bof and oRs.eof) then
oRs.move (Cint(NoncePage)-1)*100,1
for i=1 to oRs.pagesize
%>

<tr>
<td width="150" align="center"><%=oRs("IP")%></td>
<td width="200" align="center"><%=oRs("MAC")%></td>
<td width="65" align="center"><%=oRs("VLAN")%></td>
<td width="110" align="center"><%=oRs("Port")%></td>
<td width="110" align="center"><%=oRs("Aging")%></td>
<td width="110" align="center"><%=oRs("Type")%></td>


</tr>
<% oRs.movenext
if oRs.eof then exit for
next
else
response.write "<tr><td colspan=13><marquee scrolldelay=120 behavior=alternate>没有找到任何记录!!!</marquee></td></tr>"
end if

oRs.close
%>

</table>
</table>
<table width="736" border="0">
<tr><td height="17">
<div align="right">
<input type="hidden" name="page" value="<%=NoncePage%>">
<%
if NoncePage>1 then
response.Write" |<A href=searchtwo1.asp?page=1&sContent= "& scontent & "& sc="& sc &">首页 </A>| |<a href=lsearchtwo1.asp?page="&NoncePage-1&"&sContent="& scontent & "& sc="& sc &">上一页</a>|  "
else
response.write "|首 页| |上一页| "
end if
if Cint(Trim(NoncePage))<Cint(Trim(NumPage)) then
response.write "|<a href=searchtwo1.asp?page="&NoncePage+1&"&sContent= "& scontent & "& sc="& sc &">下一页</a>| |<a href=searchtwo1.asp?page="&NumPage&"&sContent= "& scontent & "& sc="& sc &">尾 页</a>|"
else
response.write "|下一页| |尾 页|"
end if
%>
 页次:<font color="#0033CC"><%=NoncePage%></font>/<font color="#0033CC"><%=NumPage%></font>
共<font color="#0033CC"><%=NumRecord%></font>条记录  </div>
</td></tr>
</table>
</center></div>
</td></tr></table>

<!--#include file="..\CommonFile\pagefoot.asp"-->
</body>
</html>






代码很简单的,做了一个下拉搜索框,用到了两个参数,搜索出结果后需要分页显示,两个参数我都已经传给链接了,可为什么还是不能实现呢???真是搞不明白了!!!!!!!!!跪求高手解决!!!!!!!!!!!
...全文
79 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
云里追梦 2010-07-16
  • 打赏
  • 举报
回复
设置RS的当前记录页为当前页!
wqjywyg2009 2010-07-16
  • 打赏
  • 举报
回复
友情帮顶!!!
anquan007 2010-07-16
  • 打赏
  • 举报
回复
没人帮忙看看吗???!!!!!

28,408

社区成员

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

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