求助:分页代码的错误解决方法

错误信息如下:

Microsoft JET Database Engine '80040e14' 

语法错误 (操作符丢失) 在查询表达式 'bid= and yuy=1' 中。 

\news_class.asp, line 104

知道是两个参数没有传递过来,但是本人刚入门不清楚如何改,请高手帮小弟看下问题 解决一下。先谢谢了!


代码如下:


<table width="80%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="30" colspan="2"><strong><span style="font-size:12px;color:#FF6600;">&nbsp;&nbsp;<%
if request("classname")<>"" then
response.write ""&request("classname")&""
else
response.write "新闻列表"
end if%>&nbsp;&nbsp;</span></strong></td>
            </tr>
            <tr>
              <td width="4%">&nbsp;</td>
              <td width="96%">
        <%
        Set rs=Server.CreateObject("ADODB.RecordSet")
        strsql="select * from news where bid="&request("classid")&" and yuy=1 order by id desc"
rs.Open strsql,conn,1,1
if not rs.eof then
rs.movefirst
  if not isempty(request("page")) then   
             pagecount=cint(request("page"))   
          else   
           pagecount=1   
          end if
        rs.pagesize=15
        if pagecount>rs.pagecount or pagecount<=0 then              
           pagecount=1              
        end if              
        rs.AbsolutePage=pagecount
         n=1
         do while not rs.eof and n<=rs.pagesize%>

                <table width="100%" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="8"><a href="news_show.asp?id=<%=rs("id")%>" target="_blank"><img src="images/page.gif" width="13" height="18" border="0"></a></td>
                    <td width="403">&nbsp;<a href="news_show.asp?id=<%=rs("id")%>"><%=rs("title")%></a><font class="txt" color="#cccccc"> &nbsp; &nbsp;[<%=rs("datetime")%>] </font></td>
                  </tr>
                </table>
                             <%n=n+1
  rs.movenext
  loop
  %>

                <table width="100%" height="40" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="txt">第<font color=#FF6600><%=pagecount%></font>页/共<font color=#FF6600><%=rs.pagecount%></font>页
                            <%
 if rs.pagecount>1 then

     if pagecount=1 then
response.write"首页&nbsp;&nbsp;"
response.write"上一页&nbsp;&nbsp;"
    response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&(cstr(pagecount)+1)&">下一页</a>"
response.write"&nbsp;<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&rs.pagecount&">尾页</a>"
else
response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page=1>首页</a>&nbsp;&nbsp;"
response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&(cstr(pagecount)-1)&">上一页</a>&nbsp;&nbsp;"

            if pagecount=rs.pagecount then 
response.write"下一页&nbsp;&nbsp;"
response.write"尾页&nbsp;&nbsp;"
            else
    response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&(cstr(pagecount)+1)&">下一页</a>"
response.write"&nbsp;<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&rs.pagecount&">尾页</a>"
end if
            end if

q=(cstr(pagecount)-1)\10
    if q<0 then
       q=1
    end if
    p=(q*10)+1
    do while p<((q*10)+11)
       If p=pagecount Then                        
       Elseif p<=rs.pagecount then
       End If
       p=p+1
        loop
    A=rs.pagecount
    if (A mod 10)=0 then
        A=rs.pagecount-1
    end if


    if pagecount<(A\10)*10 then
   response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&((((cstr(pagecount)-1)\10)+1)*10)+1&">>></a>"
    end if
if pagecount<(A) then
    end if
 End If%>                    </td>
                    </tr>
                </table><%
      end if
  rs.close
  set rs=nothing
  conn.close
  set conn=nothing
%></td>
            </tr>
          </table>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值