清指教!!!谢谢!!!
ADODB.Field 错误 '80020009'
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/bbs/shop/cat.asp,行 0
cat.asp
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
dim sortsid,i,strcat
sortsid=request.querystring("catid")%>
<title><%=webname%></title>
<!--#include file="include/header.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select category from category where categoryid="&sortsid&" ",conn,1,1
strcat = trim(rs("category"))
rs.close
set rs = nothing
%>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" background="images/mainbg2.gif">
<tr>
<td><TABLE WIDTH="720" BORDER="0" CELLSPACING="0" CELLPADDING="0" align="center">
<TR>
<TD width="135" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><!--#include file="include/cat.asp"--></td>
</tr>
</table>
<td BGCOLOR=<%=bgclr4%> valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" bgcolor="#FC03B1"></td>
</tr>
</table>
<table width="95%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"> </td>
</tr>
<tr>
<td valign="top"><%
Const MaxPerPage=12
dim totalPut
dim CurrentPage
dim TotalPages
dim j
dim sql
if Not isempty(request("page")) then
currentPage=Cint(request("page"))
else
currentPage=1
end if
if sortsid="" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select top 20 prename,company,mark,pretype,intro,other,type,viewnum,grade,predate,id,name,introduce,price1,price2,discount,productdate,pic from product order by adddate desc",conn,1,1
else
set rs=server.CreateObject("adodb.recordset")
rs.open "select predate,prename,company,mark,pretype,intro,name,other,type,viewnum,grade,id,introduce,price1,price2,discount,productdate,pic from product where categoryid="&sortsid&" order by adddate desc",conn,1,1
end if
if err.number<>0 then
response.write "数据库中暂时无数据"
end if
if rs.eof And rs.bof then
Response.Write "<p align='center' class='contents'> 对不起,此分类暂时还没有商品!</p>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"cat.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"cat.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"cat.asp"
end if
end if
end if
sub showContent
dim i
i=0
%>
<%do while not rs.eof%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="33%"><TABLE cellSpacing=0 cellPadding=3 width="100%" align=center
border=0>
<TBODY>
<TR>
<TD vAlign=center width="30%"><a href=product.asp?id=<% = rs("id") %>> </a><A HREF=product.asp?id=<%=rs("id")%>>
</A><a href=product.asp?id=<% = rs("id") %>>
<% if trim(rs("pic"))<>"" then %>
<img src=<% = trim(rs("pic")) %> border=0 width="<% = webimg9 %>" height="<% = webimg10 %>"></a>
<% else %>
<img src=images/noimage.gif border=0 width="100" height="100">
<% end if %></TD>
</TR>
<TR>
<TD><a href=product.asp?id=<%=rs("id")%>><font color="#000000"><%=trim(rs("name"))%></font></a></TD>
</TR>
<TR>
<TD><font color="#FC03B1">¥<b><%=rs("price2")%></b></font></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</TBODY>
</TABLE>
<%rs.movenext%></td>
<td width="33%"><TABLE cellSpacing=0 cellPadding=3 width="100%" align=center
border=0>
<TBODY>
<TR>
<TD vAlign=center width="30%"><a href=product.asp?id=<% = rs("id") %>> </a><a href=product.asp?id=<% = rs("id") %>>
<% if trim(rs("pic"))<>"" then %>
<img src=<% = trim(rs("pic")) %> border=0 width="<% = webimg9 %>" height="<% = webimg10 %>"></a>
<% else %>
<img src=images/noimage.gif border=0 width="100" height="100">
<% end if %></TD>
</TR>
<TR>
<TD><a href=product.asp?id=<%=rs("id")%>><font color="#000000"><%=trim(rs("name"))%></font></a></TD>
</TR>
<TR>
<TD><font color="#FC03B1">¥<b><%=rs("price2")%></b></font></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</TBODY>
</TABLE>
<%rs.movenext%></td>
<td width="33%"><TABLE cellSpacing=0 cellPadding=3 width="100%" align=center
border=0>
<TBODY>
<TR>
<TD vAlign=center width="30%"><a href=product.asp?id=<% = rs("id") %>> </a><a href=product.asp?id=<% = rs("id") %>>
<% if trim(rs("pic"))<>"" then %>
<img src=<% = trim(rs("pic")) %> border=0 width="<% = webimg9 %>" height="<% = webimg10 %>"></a>
<% else %>
<img src=images/noimage.gif border=0 width="100" height="100">
<% end if %></TD>
</TR>
<TR>
<TD><a href=product.asp?id=<%=rs("id")%>><font color="#000000"><%=trim(rs("name"))%></font></a></TD>
</TR>
<TR>
<TD><font color="#FC03B1">¥<b><%=rs("price2")%></b></font></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</TBODY>
</TABLE>
<%rs.movenext%></td>
<td width="30%">
<TABLE cellSpacing=0 cellPadding=3 width="100%" align=center
border=0>
<TBODY>
<TR>
<TD vAlign=center width="30%"><a href=product.asp?id=<% = rs("id") %>> </a><a href=product.asp?id=<% = rs("id") %>>
<% if trim(rs("pic"))<>"" then %>
<img src=<% = trim(rs("pic")) %> border=0 width="<% = webimg9 %>" height="<% = webimg10 %>"></a>
<% else %>
<img src=images/noimage.gif border=0 width="100" height="100">
<% end if %></TD>
</TR>
<TR>
<TD><a href=product.asp?id=<%=rs("id")%>><font color="#000000"><%=trim(rs("name"))%></font></a></TD>
</TR>
<TR>
<TD><font color="#FC03B1">¥<b><%=rs("price2")%></b></font></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</TBODY>
</TABLE>
</td>
</tr>
<tr>
<td colspan="4"><hr size="1" color="#E1E1E1"></td>
</tr>
</table>
<%
i=i+1
if i>=3 then Exit Do
rs.movenext
loop
rs.close
set rs=nothing
%>
<%
End Sub
Function showpage(totalnumber,maxperpage,filename)
Dim n
If totalnumber Mod maxperpage=0 Then
n= totalnumber \ maxperpage
Else
n= totalnumber \ maxperpage+1
End If %>
<form method=Post action=<% = filename %>?catid=<% = sortsid %>>
<div align="right">
<%
If CurrentPage<2 Then %>
首页 上一页
<% Else %>
<div align="center">
<a href=<% = filename %>?page=1&catid=<% = sortsid %>>首页</a> <a href=<% = filename %>?page=<% = CurrentPage-1 %>&catid=<% = sortsid %>>上一页</a>
<%
End If
If n-currentpage<1 Then %>
下一页 尾页
<% Else %>
<a href=<% = filename %>?page=<% = (CurrentPage+1) %>&catid=<% = sortsid %>>下一页</a> <a href=<% = filename %>?page=<% = n %>&catid=<% = sortsid %>>尾页</a>
<% End If %>
第<b>
<% = CurrentPage %>
</b>页
共<b>
<% = n %>
</b>页
共<b>
<% = totalnumber %>
</b>件
每页<b>
<% = maxperpage %>
</b>件
转到
<input type='text' name='page' size=2 maxlength=10 value=<% = currentpage %>>
页
<input type='submit' class='contents' value='跳转' name='cndok'>
</div>
</form>
<%
End Function
%>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<!--#include file="include/footer.asp"-->
Microsoft JET Database Engine 错误 '80040e14'
语法错误 (操作符丢失) 在查询表达式 'id=' 中。
/bbs/shop/product.asp,行 15
product.asp
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%dim id
id=request.QueryString("id")%>
<%
dim sortsid,i,strcat
sortsid=request.querystring("catid")%>
<head>
<title><%=webname%> | 商品详细资料</title>
<!--#include file="include/header.asp"-->
<%
dim prename,company,intro,predate,graph2,description,remarks,price,rs2
set rs2=server.CreateObject("adodb.recordset")
rs2.open "select * from product where id="&id,conn,1,3
rs2("viewnum")=rs2("viewnum")+1
rs2.update%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="images/mainbg2.gif"><TABLE align="center" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="720">
<TR>
<TD BGCOLOR=#FFFFFF HEIGHT="1"></TD>
</TR>
<TR>
<TD valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="9" height="25" bgcolor="#FC03B1"></td>
<td width="711" bgcolor="#FC03B1"><font class=font_14px color="#ffffff"><b><%=trim(rs2("name"))%></b></font>
</td></tr>
</table>
</TD>
</TR>
<TR>
<TD WIDTH="760" bgcolor="#FFFFFF"><TABLE WIDTH="98%" BORDER="0" ALIGN="center" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="30%" height="207" rowspan="2" align="center" valign="middle"><%if trim(rs2("pic"))<>"" then %>
<img src=<% = trim(rs2("pic")) %> border=0 alt=<% = trim(rs2("name")) %>>
<% else %>
<img src=images/noimage.gif alt=此商品暂时没有图片 width="<% = webimg9 %>" height="<% = webimg10 %>">
<% end if %>
</TD>
<TD WIDTH="85%"><table width="100%" border="0" align="center" cellpadding="5" cellspacing="1">
<tr>
<td colspan="3"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="331"><b>
<% = rs2("prename") %></b><%=trim(rs2("name"))%></td>
<td width="58"><a href=# onClick="javascript:window.open('cart.asp?id=<% = rs2("id") %>','','width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><img src=images/skin/default/cart.gif width=50 height=19 align=absmiddle border=0></a></td>
<td width="58"><a href=# onClick="javascript:window.open('addto.asp?id=<% = rs2("id") %>&action=add','','width=632,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><img src=images/skin/default/addto.gif width=50 height=19 align=absmiddle border=0></a></td>
<td width="64"><div align="right"><FONT class=fonten_9px COLOR="#000000">view:<%=trim(rs2("viewnum"))%></FONT></div></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3"><b>
<% = rs2("pretype") %></b><%=trim(rs2("type"))%>
</td>
</tr>
<tr>
<td colspan="3"><b>
<% = rs2("company") %></b><%=trim(rs2("mark"))%></td>
</tr>
<tr>
<td colspan="3"><b>
<% = rs2("intro") %></b><%=trim(rs2("introduce"))%></td>
</tr>
<tr>
<td colspan="3"><b>
<% = rs2("predate") %></b><%=trim(rs2("productdate"))%>上架</td>
</tr>
<tr>
<td colspan="3"><b>价格:</b><%=rs2("price2")%>元</td>
</tr>
<tr>
<td width="30%"><b>共售:</b><%=rs2("amount")%> 件</td>
<td width="37%"><b>库存:</b><%=rs2("stock")%> 件</td>
<td width="33%"> </td>
</tr>
</table></TD>
</TR>
</TABLE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" align="center">
<TR>
<TD align="center"><table width="680" border="0" cellspacing="0" cellpadding="5">
<tr>
<td><hr size="1" color="#E1E1E1"></td>
</tr>
<tr>
<td width="85%" align="center"><%if trim(rs2("pic"))<>"" then
response.write "<img src="&trim(rs2("photo"))&">"
else
response.Write "<img src=images/emptybook.jpg alt=此商品暂时没有大图片!>"
end if%>
</td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="85%" valign="top"><b><%=trim(rs2("description"))%></b>
<%if rs2("detail")<>"" then
response.write "<table width=19 height=4 border=0 cellpadding=0 cellspacing=0><tr><td height=4></td></tr></table>"&trim(rs2("detail")&"<table width=19 height=6 border=0 cellpadding=0 cellspacing=0><tr><td height=6></td></tr></table>")
end if
%>
</td>
</tr>
<tr>
<td height="29"> </td>
</tr>
</table></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE></td>
</tr>
</table>
<!--#include file="include/footer.asp"-->