标题:请教高手:搜索类问题
取消只看楼主
hwqde
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2007-10-7
 问题点数:0 回复次数:2 
请教高手:搜索类问题
问题描述:
搜索时,如果有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" />&nbsp;<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">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;您的位置:搜索</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 ("第一页&nbsp;&nbsp;&nbsp;上一页")
        else
       %>
             <a href=?pagenum=1>第一页</a>&nbsp;&nbsp;&nbsp;<a href=?pagenum=<%=(pagenum-1)%>>上一页</a>                    
             <%
        end if
        if cint(pagenum)=pagecount then
            Response.Write ("&nbsp;&nbsp;下一页&nbsp;&nbsp;尾页")
        else
        %>
           &nbsp;&nbsp;<a href=?pagenum=<%=(pagenum+1)%>>下一页</a>&nbsp;&nbsp;&nbsp;<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>&nbsp; Google  百度  雅虎 &nbsp;中国制造网</div>
     <div id="int">Copyright</div>
</div>
</body>
</html>
搜索更多相关主题的帖子: 搜索 参数 Recordset 
2008-08-16 14:27
hwqde
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2007-10-7
得分:0 
3Q,我试试去

2008-08-16 15:33
hwqde
Rank: 1
等 级:新手上路
帖 子:33
专家分:0
注 册:2007-10-7
得分:0 
还是不行,麻烦帅哥明示

2008-08-16 15:57



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-228593-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.338637 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved