问题依旧?

lxg 2000-02-24 07:34:00
在调试时变量id是用循环从表中提取的,按你的方法做后,表中数据并未修改。我现把源程序附后请赐教!源程序如下:
<!--#include file="Util.asp" -->

<%
Head="您的购物车"

ProductList = Session("ProductList")
If Len(ProductList) = 0 Then Response.Redirect "Nothing.asp"

DbPath = SERVER.MapPath("ShopBag.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath

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"

conn.Execute("Select CStr(now()) As IndentId,ProductId,ProductName,Price,0 As Quatity,0 As SubTotal Into Tb From Products Where ProductID In (" & ProductList & ")")
Set rs = conn.Execute( sql )

%>

<HTML>
<HEAD><TITLE><%=Head%></TITLE></HEAD>
<BODY>
<H2 ALIGN=CENTER><img border="0" src="images/title.gif"><br></h2>

<HR>
<CENTER>
<Form Action=Check.asp Method=POST>
<Input Type=Hidden Name=MySelf Value=Yes>
<TABLE Border=1>
<TR><TD Align=Right ColSpan=7>
<p align="center"><Font Color=Red>您购买的商品</Font></p>
</TD></TR>
<TR BGCOLOR=#00FFFF>
<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
Session(rs("ProductID")) = Quatity
Sum = Sum + CDbl(rs("Price")) * Quatity
%>
<TR>
<TD Align=Center>
<Input Type=CheckBox Name=" " Value="<%=rs("ProductID")%>" Checked>
</TD>
<%ProductId1=rs("ProductID")%>
<TD><%=ProductId1%></TD>

<TD><%=rs("ProductName")%></TD>
<TD Align=Right><%=rs("Price")%></TD>
<TD><Input Type=Text Name="<%="Q_" & rs("ProductID")%>" Value=<%=Quatity%> Size=3></TD>
<TD Align=Right><%=CDbl(rs("Price"))*Quatity%></TD>
<TD><A HREF=<%=rs("Link")%>><%=rs("Description")%></A></TD>
</TR>
<% conn.execute("Update Tb Set Quatity=" & Quatity & ",Subtotal=Price*" & Quatity & " Where ProductId='" & ProdcutId1 & "'")
rs.MoveNext
Wend
%>
<TR><TD Align=Right ColSpan=7><Font Color=Red>总价格=<%=Sum%></Font></TD></TR>
</TABLE>


 
<p>
<FONT size=3><B>请在改变了数量或放弃了某一项后,点按“更新购物车”按钮!</B></FONT>

</p>
<p>
 

<Input Type=Submit Value="更新购物车">  
</p>
</Form>
</CENTER>
<form method="POST" action="CHECK1.ASP" webbot-action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" startspan U-File="_private/form_results.txt"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot
bot="SaveResults" endspan i-checksum="43374" -->
<center><table border="0" width="420" cellpadding="3">
<tr>
<td bgcolor="#CCCC99" height="20" class="big" valign="bottom" align="center">  <font color="#FFFFFF">您的个人信息</font></td>
</tr>
<tr>
<td align="center"><span STYLE="width: 420; text-align: left; font-size: 9pt; position: relative; padding: 2pt 2pt; border-width: thin; border-style: groove;">
<table border="0" width="100%" cellpadding="3">
<tr>
<td>姓    名:<input type="text" name="T1" size="20"><%=name%>
</td>
<td>地    址:<input type="text" name="T2" size="20"><%=address%>
</td>
</tr>
<tr>
<td>所在城市:<input type="text" name="T3" size="20"><%=city%>
</td>
<td>邮政编码:<input type="text" name="T4" size="20"><%=zip%>
</td>
</tr>
<tr>
<td>联系电话:<input type="text" name="T5" size="20"><%=phone%>
</td>
<td>电子邮件:<input type="text" name="T6" size="20"><%=email%>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#C0C0C0">您选择的送货方式:<input type="text" name="T7" size="20"><%=fashion%>
</td>
</tr>
<tr>
<td colspan="2">您的其他要求:
<p><textarea rows="2" name="S1" cols="20"></textarea></td>
</tr>
</table>
</span></td>
</tr>
</table></center>
<CENTER>
<p><input type="submit" value="提交" name="B1">     <input type="reset" value="重写" name="B2"></p>
</form>
<p> </p>
<HR>
<a href="Gwjs.htm">去收银台</a>   <A HREF=Clear.asp>退回所有物品</A><P>
<% ListCategory conn %>
</CENTER>
</BODY>
</HTML>

...全文
151 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
lxg 2000-02-24
  • 打赏
  • 举报
回复
执行:
<% conn.execute("Update Tb Set Quatity=" & Quatity & ",Subtotal=Price*" & Quatity & " Where ProductId='" & ProdcutId1 & "'")
%>
后,库中的数据并没有被修改。这就是我的问题。
cloud 2000-02-24
  • 打赏
  • 举报
回复
请问什么错误。

28,390

社区成员

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

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