错误信息如下:
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;"> <%
if request("classname")<>"" then
response.write ""&request("classname")&""
else
response.write "新闻列表"
end if%> </span></strong></td>
</tr>
<tr>
<td width="4%"> </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"> <a href="news_show.asp?id=<%=rs("id")%>"><%=rs("title")%></a><font class="txt" color="#cccccc"> [<%=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"首页 "
response.write"上一页 "
response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&(cstr(pagecount)+1)&">下一页</a>"
response.write" <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> "
response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&(cstr(pagecount)-1)&">上一页</a> "
if pagecount=rs.pagecount then
response.write"下一页 "
response.write"尾页 "
else
response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&(cstr(pagecount)+1)&">下一页</a>"
response.write" <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>
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;"> <%
if request("classname")<>"" then
response.write ""&request("classname")&""
else
response.write "新闻列表"
end if%> </span></strong></td>
</tr>
<tr>
<td width="4%"> </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"> <a href="news_show.asp?id=<%=rs("id")%>"><%=rs("title")%></a><font class="txt" color="#cccccc"> [<%=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"首页 "
response.write"上一页 "
response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&(cstr(pagecount)+1)&">下一页</a>"
response.write" <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> "
response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&(cstr(pagecount)-1)&">上一页</a> "
if pagecount=rs.pagecount then
response.write"下一页 "
response.write"尾页 "
else
response.write"<a href=?type_id="&type_id&"&keyword="&keyword&"&page="&(cstr(pagecount)+1)&">下一页</a>"
response.write" <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>