请教高手:搜索类问题
问题描述:搜索时,如果有20条数据,分两页显示,每页显示10条。但是点击下一时会出现如下错误:
ADODB.Recordset 错误 '800a0bb9'
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
第199行;
望高手指教!
<!--#include file="conn.asp"-->
<%
fenlei=trim(request.Form("fenlei"))
content1=request.Form("content1")
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>搜索</title>
<style type="text/css">
<!--
@import url("css.css");
-->
</style>
</head>
<body>
<div id="header">
<div id="left">
<ul>
<li><strong><a href="index.asp">中文版</a></strong></li>
<li><a href="eindex.asp">English</a></li>
</ul>
</div>
<div id="middle"><img src="img/logo.jpg" width="193" height="59" /></div>
<div id="right">
<ul>
<li><a href="">收藏本站</a></li>
<li><a href="">设为首页</a></li>
</ul>
</div>
<div id="bottom">
<div id="bottomleft">
<ul>
<strong><li><a href="index.asp">首页</a></li></strong>
<li><a href="index.asp">公司简介</a></li>
<li><a href="pro.asp">产品展示</a></li>
<li><a href="message.asp">在线留言</a></li>
<li><a href="contact.asp">联系我们</a></li>
</ul>
</div>
<div id="bottomright">
<form action="searchshow.asp" method=post>
<img src="img/search.jpg" /> <input name=content1 type=text value="" size="15">
<select name=fenlei>
<option value="cp_name">产品名称</option>
<option value="cp_demo">产品描述</option>
</select>
<input type=submit value="搜 索"class="button">
</form>
</div>
</div>
</div>
<div id="content">
<div id="leftside">
<div id="leftsidemiddle" >
<h3>联系方式</h3>
<p>广东省深圳市罗湖区罗湖街166号</p>
</div>
<div id="leftsidebottom">
<h2>产品类别</h2>
<ul>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from cp"
rs.open sql,conn,1,1
dim pagenum1
dim e_page1
e_page1=13 '每页显示数
if request.querystring("pagenum1")="" or request.querystring("pagenum1")=0 then
pagenum1=1
else
pagenum1=request.querystring("pagenum1")
rs.absolutepage=trim(request.querystring("pagenum1"))
end if
do while not rs.eof and e_page1>0
%>
<div class="ul">
<%
for i=1 to 1
if not rs.eof then
%>
<li><strong ><a href="pro2.asp?feilei2=<%=rs("feilei2")%>" target="_blank"><%=rs("feilei")%></a></strong></li>
<%
e_page1=e_page1-1
rs.movenext
end if
next
%>
</div>
<%
loop
%>
</ul>
</div>
</div>
<div id="rightside">
<div id="rightsidetop"> 您的位置:搜索</div>
<div id="rightsidebottom">
<h2>::以下是搜索的结果::</h2>
<p></p>
<p><table width="360" border=0 align="center" cellpadding=0 cellspacing=0>
<% set rs2=server.createobject("adodb.recordset")
if fenlei="cp_name" then
sql2="select * from cp where cp_name like '%"&content1&"%'order by id "
end if
if fenlei="cp_demo" then
sql2="select * from cp where cp_demo like '%"&content1&"%'order by id"
end if
%>
<%
rs2.open sql2,conn,1,1
dim pagenum
dim e_page
e_page=10'每页显示数rs2.pagesize=e_page
pagecount=rs2.pagecount
if request.querystring("pagenum")="" or request.querystring("pagenum")=0 then
pagenum=1
else
pagenum=request.querystring("pagenum")
rs2.absolutepage=trim(request.querystring("pagenum"))
end if
do while not rs2.eof and e_page>0
%>
<tr>
<%
for i=1 to 4
if not rs2.eof then
%>
<td>
<table border=0 width="118" cellpadding=0 cellspacing=0>
<tr>
<td><a href="show.asp?id=<%=rs2("id")%>" target="_blank"><img src=<%=rs2("pic")%> border=0 width="116"></a></td>
</tr>
<tr>
<td align=center><a href="show.asp?id=<%=rs2("id")%>" target="_blank"><%=rs2("cp_name")%></a></td>
</tr>
</table>
</td>
<%
e_page=e_page-1
rs2.movenext
end if
next
%>
</tr>
<tr><td colspan=2 height=4></td></tr>
<%
loop
%>
<tr>
<td height="30" align="center" colspan=3>
<div align="right">
<%
if pagenum=1 then
Response.Write ("第一页 上一页")
else
%>
<a href=?pagenum=1>第一页</a> <a href=?pagenum=<%=(pagenum-1)%>>上一页</a>
<%
end if
if cint(pagenum)=pagecount then
Response.Write (" 下一页 尾页")
else
%>
<a href=?pagenum=<%=(pagenum+1)%>>下一页</a> <a href=?pagenum=<%=pagecount%>>尾页</a>
<%end if%>
第<font color=#ff3300><%=pagenum%></font>页 共<font color=#ff3300><%=pagecount%></font>页<font color=#ff3300><%=rs2.recordcount%></font>条 </div></td>
</tr>
</table>
<%rs2.close%>
</p>
</div>
</div>
</div>
<div id="footer">
<div id="link"><strong>友情连接</strong>:</block> Google 百度 雅虎 中国制造网</div>
<div id="int">Copyright</div>
</div>
</body>
</html>