急啊?不知道那里出错了????

leo1985129 2004-06-23 11:08:32
数据库绝对没有问题
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="util.asp"-->
<%
if request("submit")="我要结帐" then
if session("usr")="" then
response.Redirect("enter/enter.asp")
end if
ProductList=session("Productlist")
usr=session("usr")
pwd=session("pwd")
Products=split(ProductList,",")
for i=0 to UBound(Products)
sql="insert into goods_buyed(帐号,商品,数量,IP)values('"
sql=sql&usr&"',"
sql=sql&Products(i)&","
sql=sql&request("Q_"&replace(Products(i),"'",""))&",'"
sql=sql&request("remote_addr")&"')"
con.execute sql
next
%>
<script language="JavaScript">
window.alert("您已经完成了购物的过程,谢谢您的支持");
window.location.href="enter/abandon.asp"
</script>
<%
response.End()
end if
%>

<%
Head="以下是您购物的清单"
ProductList=session("ProductList")
if len(ProductList)=0 then
response.Redirect("nothing.asp")
end if
if request("MySelf")="Yes" then
ProductList=""
Products=split(Request("ProductID"),",")
for I=0 to UBound(Products)
PutToShopBag Products(I),ProductList
next
session("ProductList")=ProductList
end if
sql="select * from Products"
sql=sql&"Where ProductID In("&ProductList&")"
sql=sql&"Order By ProductID"
set rs=conn.execute(sql)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=Head%></title>
</head>

<body>
<h2 align="center"><%=Head%></h2><hr>
<center>
<form action="check.asp" method="post">
<input type="hidden" name="MySelf" value="Yes">
<table border="1">
<tr>
<td>取消</td>
<td>商品编号</td>
<td>商品名称</td>
<td>单价</td>
<td>数量</td>
<td>总价</td>
<td>商品简介</td>
</tr>
<%
Sum=0
while not rs.eof
Quatity=Cint(Request("Q_"&rs("ProductID")))
if Quatity <= 0 then
Quatity=cint(session(rs("ProductID")))
if Quatity <=0 then
Quatity=1
end if
end if
session(rs("ProductID"))=Quatity
Sum=Sum+CDbl(rs("Price"))*Quatity
%>
<tr>
<td><input type="checkbox" name="ProductID" value="<%=rs("ProductID")%>" checked></td>
<td><%=rs("ProductID")%></td>
<td><%=rs("ProductName")%></td>
<td><%=rs("Price")%></td>
<td><input type="text" name="<%="Q_"&rs("ProductID")%>" value="<%=Quatity%>" size="3"></td>
<td><%=CDbl(rs("Price"))*Quatity%></td>
<td><%=rs("Description")%></td>
</tr>
<%
rs.movenext
wend
%>
<tr>
<td colspan="7">总价格:<%=Sum%></td>
</tr>
</table>
<input type="submit" value="我要结帐">
<input type="submit" value="更改数量">
</form>
<hr>
<a href="clear.asp">退回所有商品</a><p>
<%ListCategory conn%>
</center>
</body>
</html>

出现的错误是:
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]在关键字 'In' 附近有语法错误。

/shop/check.asp,行48



是怎么回事啊?
...全文
49 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
leo1985129 2004-06-23
  • 打赏
  • 举报
回复
productList没有为空,而且in后面有空格
聂niexiaolin 2004-06-23
  • 打赏
  • 举报
回复
可能ProductList为空,所以用in会有错误,而且好象in后面要有空格的!

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧