| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 431 人关注过本帖
标题:[求助]asp 缺少语句
取消只看楼主 加入收藏
mmao
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2006-12-20
收藏
 问题点数:0 回复次数:0 
[求助]asp 缺少语句

各位大侠小弟编写的购物车除了点问题!
错误类型:
Microsoft VBScript 编译器错误 (0x800A0400)
缺少语句
/viewcart.asp, line 76
<input type=button name="close" value="继续购物" onclick="window.close()">&nbsp;


源文件

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<! --include file="config.inc"-->
<%
'函数sqlstr 用来规范sql查询语句
function sqlstr(data)
sqlstr="'" & replace(data,"'","''") & "'"
end function
'连接数据库
set conn=server.createobject("adodb.connection")
conn.open connstring
set objbuyrs=server.createobject("adodb.recordset")
if session("insert")=sessionid then
session("insert")=false
for each key in request.Cookies("itembuy")
response.Cookies("itembuy")
next
end if
if not request.Cookies("itembuy").haskeys then
response.Write "<font style=""font:10pt;color:ff0000"">目前您的购物车里还没有商品</font>"
session("hasitem")=false

response.Write "<input tyle=button value=""继续购物"" onclick=""window.close()"">"
else
point=1 '循环变量用来遍历cookies字典itembuy
count=cint(request.Cookies("itembuy".count) ) '字典关键字的数量

do while point<=count
if request.Cookies("itembuy")(point)="" then
point=point+1 '如果此关键字为空,则继续循环
else
exit do
end if
loop
if point>count then
response.Write "<font stlyle=""font:10pt;color:ff0000"">目前您的购物车里没有商品</font>"
session("hasitem")=false
response.Write "<hr color=#999933 size=1>"
response.Write "<input tyle=button value=""继续购物"" onclick=""window.close()"">"
else
response.Write "<font style=""font:10pt;color:ff0000"">您已经选择了以下商品<br>如果有您不需要的,在购买数中输入0就即可</font>"
response.Write "<hr color=#999933 size=1>"
response.Write "<center><table><tr><td width=50>编号</td><td width=150>名称</td><td width=100>单价</td><td width=100>购买数</td></tr>"
response.Write "<form action=""forinvoice.asp"" method=post target=""main"" name=""view"">"

do while point<=count
'获取商品的编号
productid=request.Cookies("itembuy")(point)
if productid="" then
point=point+1
else
ssql="select * from product where productid=" & sqlstr(productid)
objbuyrs.activeconnection=conn
objbuyrs.source=ssql
objbyrs.open

response.Write "<tr><td>" & objbuyrs("productid") & "</td>"
response.Write "<td>" & objbuyrs("name") & "</td>"
response.Write "<td>" &objbuyrs("price") & "</td>"
nametemp=objbuyrs("productid")
response.Write "<td><input type=text size=2 value=1 name=" & nametemp &"></td>"
response.Write "</tr>"
point=point+1
if point>request.Cookies("itembuy").count then
exit do
end if
objbuyrs.close
end if
loop
response.Write "</table>"
conn.close
set conn=nothing

response.Write "<hr color=#999933 size=1>"

<input type=button name="close" value="继续购物" onclick="window.close()">&nbsp;

<input type=button NAME="remove" value="清空购物车" onclick="window.open('removecart.asp','_self')">
</form>

<%
end if
end if
%>

<html>
<head>
<meta http-equiv="Content-language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查看购物车</title>
<style><!--
td{font:10pt;color:#6600ff;}
input{background-color:#eeeeee;border-stye:solid;border-color:#6666cc;border-width:1;}
--></style>
</head>
<body style="font:10pt" bgcolor="ffffff">
</body>
</html>

<script language="vbscript">
<!--
sub view_onsubmit()
window.close()
end sub
-->
</script>

[此贴子已经被islet于2006-12-20 13:50:55编辑过]

搜索更多相关主题的帖子: 语句 asp 
2006-12-20 12:04
快速回复:[求助]asp 缺少语句
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016788 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved