谁能解决给100分
小弟不才有个问题请教大家
http://x98188.uni.cc/amway/list.asp?classid=1
的下一页老是出错:错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
/ne/list.asp, 第 7 行
错误原因:[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'classid=' 中。
详细描述:
代码如下:
<!--#include file="conn.asp"-->
<!--#include file="Util.asp" -->
<%
classid="classid="&cstr(request("classid"))&" and "
set rs1=server.createobject("ADODB.Recordset")
sql1="select class from class where classid="&cstr(request("classid"))
rs1.open sql1,conn,3,2
%>
<%
set rs2=server.createobject("ADODB.Recordset")
sql2="Select * From Nclass where classid="&cstr(request("classid"))
rs2.open sql2,conn,3,2
%>
<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">
<!--
function MM_reloadid(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadid; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadid(true);
//-->
</script>
</head>
<link rel="stylesheet" type="text/css" href="globalstyle.css">
<body bgcolor="#efefef">
<div align="center"><center>
<table border="1" width="450" cellpadding="0" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF">
</table>
<div align="center"></div>
<table width="98%" border="0" align="center">
<tr>
<td bgcolor="#efefef">您的位置:<A href="default.asp">amway首页</A> <img border="0" src="images/More.gif">
<%=rs1("class")%> <img border="0" src="images/More.gif"> <div id="Layer1" style="position:absolute; width:200px; height:115px; z-index:2; left: 20px; top: 106px;">
<table width="79%" height="31" border="0" bordercolor="#000000">
<%
while (not rs2.eof)
%>
<tr>
<td height="25"> <a href="list.asp?classid=<%=request("classid")%>&Nclassid=<%=rs2("Nclassid")%>"><%=rs2("Nclass")%></a>
</td>
</tr>
<%
rs2.movenext
wend
%>
</table>
</div></td>
</tr>
</table>
<p> </p>
<p>
</p>
<div id="Layer2" style="position:absolute; width:510px; height:115px; z-index:1; left: 210px; top: 73px;">
<%
page=request.querystring("page")
set rs=server.createobject("ADODB.Recordset")
if request("Nclassid")="" then
sql="Select * From product where classid="&cstr(request("classid"))
else
sql="select * from product where Nclassid="&request("Nclassid")
end if
rs.open sql,conn,1,3
maxjilu=rs.recordcount
t=page*4
rs.absoluteposition=t+1
f=t+4
for i=t+1 to f
idd=rs("id")
%>
<table width="98%" height="73" border="1">
<tr>
<td width="13%" rowspan="5"><a href="detail.asp?id=<%=rs("id")%>"><img src="adm/<%=rs("content")%>" alt="" width="57" height="75" border="0"></a></td>
<td width="87%">名称:<%=rs("name")%></td>
</tr>
<tr>
<td>编号:<%=rs("bianhao")%></td>
</tr>
<tr>
<td>市场价:<%=rs("marktprice")%></td>
</tr>
<tr>
<td>会员价:<%=rs("memprice")%></td>
</tr>
<tr>
<td><a href="detail.asp?id=<%=rs("id")%>">详细介绍</a> <a href="#" onClick="***********('add.asp?cpbm=<%=rs("ProductID")%>','add','scrollbars=no,resizable=no,width=650,height=450 top=10,left=10')">购物</a></td>
</tr>
</table>
<table>
<%
rs.movenext
if rs.eof then
exit for
rs.close
conn.close
end if
next
tt=page*4
if page<0 then
page=0
end if
if tt>=maxjilu then
ttt=page-1
end if
if maxjilu-tt<4 then
ttt=page-1
else
ttt=page
end if
u=1
do while u*4<maxjilu
u=u+1
loop
session("page")=ttt
%>
<table width="97%" border="0">
<tr>
<td>
<td height="22" align="center" class="jnfont3"> <p align="right">共<%=u%>页
第<%=(page+1)%>页 | <a href=list.asp?page=0>首页</a>-<a href=list.asp?page=<%=(ttt-1)%>>上
页</a>-<a href=list.asp?page=<%=(ttt+1)%>>下页<a/>-</a><a href=list.asp?page=<%=(u-1)%>>末页</a>
<%
if ttt<=4 then
uu=0
while uu<u
%>
<a href=list.asp?page=<%=(uu)%>>[<%=(uu+1)%>]</a>
<%uu=uu+1
wend
else%>
<a href=list.asp?page=<%=(ttt-2)%>>[<%=(ttt-3)%>]</a> <a href=list.asp?page=<%=(ttt-1)%>>[<%=(ttt-2)%>]</a>
<a href=list.asp?page=<%=(ttt)%>>[<%=(ttt-1)%>]</a> <a href=list.asp?page=<%=(ttt+1)%>>[<%=(ttt)%>]</a>
<a href=list.asp?page=<%=(ttt+2)%>>[<%=(ttt+1)%>]</a>
<%end if%>
<p> </p></td>
</tr>
</table>
</div>
<p><br>
<br>
</p>
</body>
</html>