求助分页不正常
来源:互联网 发布:淘宝哪些站外网站 编辑:程序博客网 时间:2024/05/17 01:14
从查询页选择查询条件后,跳转到本页,可以查询到结果,下部三个文本框内的值也是对的,得到的where语句是where tgyc='事故不明' and qukuai_id=1and youtian_id=1 ,点击下一页后,查询结果就成了空,wwhere语句变成了where tgyc <> ''and tgyc is not null and youtian_id=
<% syoutian=trim(request.form("fyoutian"))
if syoutian="==请选择油田==" then
s1youtian=""
else
s1youtian="and youtian_id="&syoutian
end if
squkuai=trim(request.form("fqukuai"))
if squkuai="==请选择区块==" or squkuai="" then
s1qukuai=""
else
s1qukuai=" and qukuai_id="&squkuai
end if
stgyc=trim(request.form("tgyc"))
if stgyc="" then
if s1youtian="" then
s1tgyc=" where tgyc <> '' and tgyc is not null"
end if
else
s1tgyc="where tgyc='"&stgyc&"'"
end if
sxh=1
skey=s1tgyc&s1qukuai&s1youtian
set rs=server.createobject("adodb.recordset")
sql="select * from ziliao "& skey &" order by jinghao DESC"
rs.open sql,conn,1,1
if rs.eof and rs.bof then %>
共有<span style="color: #FF0000"><%=totalput%></span>条符合查询条件的记录,查询条件为:<%=skey%>
<form Action="brow-taoguanyichang.asp" Method="post" align="right">
<table border="0" width="600" cellspacing="0" cellpadding="0" height="30">
<tr>
<td width="100%" height="30">
<p align="center"><%
If currentPage <> 1 Then
Response.Write "<A HREF=brow-taoguanyichang.asp?Page=" & showpages & ">[第一页]</A> "
Response.Write "<A HREF=brow-taoguanyichang.asp?Page=" & (currentPage-1) & ">[上一页]</A> "
End If
If currentPage <> rs.PageCount Then
Response.Write "<A HREF=brow-taoguanyichang.asp?Page=" & (currentPage+1) & ">[下一页]</A> "
Response.Write "<A HREF=brow-taoguanyichang.asp?Page=" & totalPage & ">[最后一页]</A> "
End If
%> 第<font color="#FF0000"><%=currentPage%></font>页,共<font color="#FF0000"><%=totalPage%></font>页
<% response.write " 转到:<select name='page' size=1 class=smallselsect style='BACKGROUND-COLOR:#FFE7B3;font-family: 宋体; font-size: 9pt;'>"
for i=1 to n
response.write "<option value="& i
if currentpage=i then
response.write " selected"
end if
response.write ">"& i &"</option>"
next
response.write "</select>" %>
<input name="fyoutian" type="hidden" value="<%=syoutian%>">
<input name="fqukuai" type="hidden" value="<%=squkuai%>">
<input name="tgyc" type="hidden" value="<%=stgyc%>">
<%response.write " <input class=buttonface type='submit' value='确定' name='cndok' style='font-family: 宋体; font-size: 9pt;'>"%>
</td>
</tr>
</table>
</form>
<% syoutian=trim(request.form("fyoutian"))
if syoutian="==请选择油田==" then
s1youtian=""
else
s1youtian="and youtian_id="&syoutian
end if
squkuai=trim(request.form("fqukuai"))
if squkuai="==请选择区块==" or squkuai="" then
s1qukuai=""
else
s1qukuai=" and qukuai_id="&squkuai
end if
stgyc=trim(request.form("tgyc"))
if stgyc="" then
if s1youtian="" then
s1tgyc=" where tgyc <> '' and tgyc is not null"
end if
else
s1tgyc="where tgyc='"&stgyc&"'"
end if
sxh=1
skey=s1tgyc&s1qukuai&s1youtian
set rs=server.createobject("adodb.recordset")
sql="select * from ziliao "& skey &" order by jinghao DESC"
rs.open sql,conn,1,1
if rs.eof and rs.bof then %>
共有<span style="color: #FF0000"><%=totalput%></span>条符合查询条件的记录,查询条件为:<%=skey%>
<form Action="brow-taoguanyichang.asp" Method="post" align="right">
<table border="0" width="600" cellspacing="0" cellpadding="0" height="30">
<tr>
<td width="100%" height="30">
<p align="center"><%
If currentPage <> 1 Then
Response.Write "<A HREF=brow-taoguanyichang.asp?Page=" & showpages & ">[第一页]</A> "
Response.Write "<A HREF=brow-taoguanyichang.asp?Page=" & (currentPage-1) & ">[上一页]</A> "
End If
If currentPage <> rs.PageCount Then
Response.Write "<A HREF=brow-taoguanyichang.asp?Page=" & (currentPage+1) & ">[下一页]</A> "
Response.Write "<A HREF=brow-taoguanyichang.asp?Page=" & totalPage & ">[最后一页]</A> "
End If
%> 第<font color="#FF0000"><%=currentPage%></font>页,共<font color="#FF0000"><%=totalPage%></font>页
<% response.write " 转到:<select name='page' size=1 class=smallselsect style='BACKGROUND-COLOR:#FFE7B3;font-family: 宋体; font-size: 9pt;'>"
for i=1 to n
response.write "<option value="& i
if currentpage=i then
response.write " selected"
end if
response.write ">"& i &"</option>"
next
response.write "</select>" %>
<input name="fyoutian" type="hidden" value="<%=syoutian%>">
<input name="fqukuai" type="hidden" value="<%=squkuai%>">
<input name="tgyc" type="hidden" value="<%=stgyc%>">
<%response.write " <input class=buttonface type='submit' value='确定' name='cndok' style='font-family: 宋体; font-size: 9pt;'>"%>
</td>
</tr>
</table>
</form>
0 0
- 求助分页不正常
- 求助:分页代码的错误解决方法
- 求助
- 求助
- 求助
- 求助
- 求助
- 求助
- 求助!!
- 求助!!
- 求助
- 求助
- 求助
- 求助
- 求助
- 求助
- 求助
- 求助
- php连接mysql数据库实例
- springMVC+activemq整合注解方式
- 如何让google静态地图为jpg格式?
- Opencv之HOG特征与SVM相结合的人体检测(增加自举法)
- 文本转换工具
- 求助分页不正常
- 指针
- 和为n连续正数序列
- jQuery基础
- 加密算法
- 请问大侠们用Moto lwt包开发的程序能否在其他支持J2me的手机上运行?
- Java程序在linux系统下运行,为什么会占用很多虚拟内存?
- 配置电脑开发环境-拿到一个新电脑之后
- 1002. 写出这个数 (20)