CNET中国旗舰网站

ZDNet China | CNET科技资讯网 | 政府采购 | 行业网站联盟





 
标题: [求助] asp购物车问题,急等高手,指正!!!
小玩将
支柱会员
Rank: 10Rank: 10Rank: 10



UID 319552
精华 3
积分 16584
帖子 1526
威望 7556
ZD币 2005 元
阅读权限 210
注册 2008-4-16
状态 离线
  楼主
发表于 2008-4-24 16:19  资料  个人空间  短消息  加为好友 
开发者在线

asp购物车问题,急等高手,指正!!!

<!--#include   file="inc/global.asp"-->   
  <%   
  Sub   PutToShopBag(   Prodid,   ProductList   )   
        If   Len(ProductList)   =   0   Then   
              ProductList   =Prodid   
        ElseIf   InStr(   ProductList,   Prodid   )   <=   0   Then   
              ProductList   =   ProductList&",   "&Prodid   &""   
        End   If   
  End   Sub   
  %>   
   
  <html>   
  <head>   
  <title>购物车</title>   
  <meta   http-equiv="Content-Type"   c>   
  <meta   name="Robots"   c>   
  </head>   
  <body   background="<%   =   webimg15   %>"   text="#000000"   leftmargin="0"   topmargin="0">   
  <%   
  ProductList   =   Session("ProductList")   
  Products   =   Split(Request("Prodid"),   ",")   
  For   I=0   To   UBound(Products)   
        PutToShopBag   Products(I),   ProductList   
  Next   
  Session("ProductList")   =   ProductList   
   
  if   request("payment")="去收银台"   then   
  if   pay=   0   then   
  response.redirect   "payment.asp?action=1"   
  elseif   pay=   1   then   
  response.redirect   "paymentali.asp?action=1"   
   
  end   if     
   
  end   if     
   
  If   Request("cmdShow")   =   "Yes"   Then   
        ProductList   =   ""   
        Products   =   Split(Request("ProdId"),   ",   ")   
        For   I=0   To   UBound(Products)   
              PutToShopBag   Products(I),   ProductList   
        Next   
        Session("ProductList")   =   ProductList   
  End   If   
  If   Len(Session("ProductList"))   =   0   Then   
  Response.write   "<table     height=100%   width=100%     ><tr><td   align=center>您的购物车为空,<a   href=index.asp><b>继续购物   
   
  </b></a> </td></tr></table>"   
  Response.end   
  end   if   
  %>   
  <table   width="780"   border="0"   cellspacing="0"   cellpadding="0"   align="center"     bgcolor=#ffffff   >   
  <tr>     
          <td><br>  <font   color="#FF3333"   style="font-size:12px;font-weight:lighter"><b>以下是您购物车中的商品信息,   
   
  请核对正确无误后下单,请牢记你的订单号以便日后查询!<br>       </b></font></td>   
    </tr>   
  <%   
  dim   rs,strsql   
  Set   rs=Server.CreateObject("ADODB.RecordSet")     
  strsql="select   id,Product_name,Price,Item_No   from   Product   where   ID   in   ("&Session("ProductList")&")   order   by   ID"   
  rs.open   strsql,conn,1,1"-----提示这里出错。   
  %>   
  <tr>   <td>   
   
  <form   action="check.asp"   method="POST"   name="check">   
   
              <table   border="0"   cellspacing="1"   cellpadding="4"   align="center"   width="100%"   bgcolor="#cccccc">   
                          <tr     height="25"   align="center"       bgcolor=#ffffff>     
                          <td   width="80"   ><FONT   color=#000000>选中/清除</font></td>   
                          <td   width="287"><FONT   color=#000000>商   品   名   称</font></td>   
                          <td   width="140"><FONT   color=#000000>编号</font></td>   
    <td   width="47"><FONT   color=#000000>数量</font></td>   
    <td   width="69"><FONT   color=#000000>单价</font></td>   
    <td   width="102"><FONT   color=#000000>总   计</font></td>   
                      </tr>   
  <%   
  Sum   =   0   
  Quatity   =   1   
  Do   While   Not   rs.EOF   
            Quatity   =   CInt(   Request.Form(   "Q_"   &   rs("ID"))   )   
            If   Quatity   <=   0   Then     
                  Quatity   =   CInt(   Session(rs("ID"))   )   
                  If   Quatity   <=   0   Then   Quatity   =   1   
            End   If   
  Session(rs("ID"))   =   Quatity   
   
  Price   =   Round(Price,2)     
  Sum   =   Sum   +   price*Quatity   
  Sum=Round(Sum,2)     
  %>     
                      <tr   bgcolor=#ffffff   height="25"   align="center"   >     
                          <td><input   type="CheckBox"   name="ProdId"   value="<%=rs("ID")%>"   Checked></td>   
      
                          <td   align="left"> <a   href="product.asp?ID=<%=rs("ID")%>"   target="_blank"><FONT   color=#000000><%=rs   
   
  ("Name")%></font></a></td>   
                          <td><FONT   color=#000000><%=rs("item_on")%></font></td>   
  <td><FONT   color=#000000><input   type="Text"   name="<%="Q_"   &   rs("ID")%>"   value="<%   
   
  =Quatity%>"   size="2"   class="form"></font></td>   
  <td><FONT   color=#000000><%=price%></font></td>   
  <td><FONT   color=#000000><%=Round(price*Quatity,2)   %></font></td>   
                      </tr>   
                      <%   
            rs.MoveNext   
            Loop   
  rs.close   
  set   rs=nothing   
  %>     
  <tr   bgcolor=#ffffff   >     
    <td   colspan="4"   align="center"   valign="middle">                             
                                  <input   type="submit"   name="order"   value="更新商品">         
                                  <input   type="submit"   name="payment"   value="去收银台">           
                                  <input   type="button"   value="继续购物"   language=javascript      name="button">   
                                  <input   type="hidden"   name="cmdShow"   value="Yes">   
                                  </td>   
  <td   colspan="2"   height="25"><br>   
  <FONT   color=#000000>总计:</font><font   color=#000000><%=Round(Sum,2)   %> 元</font><br>   
  </td>   
                      </tr>   
              </table>   
              </form>   
    </td>   
  </tr>   
  <tr><td   height="100">  <FONT   color=#000000>温馨提示--清除选购商品的方法:去掉商品名称前的选中钩,然后点   
   
  更新商品即可!</font></td></tr>   
              </table>   
  </body>   
  </html>   
  ---------------------------------------------   
  错误提示:ADODB.Recordset   错误   '800a0bb9'     
  参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。     
  /china/check.asp,行75




顶部
热点频道推荐: C/S开发| 数据库| WEB开发| 嵌入式| 项目管理|
 



当前时区 GMT+8, 现在时间是 2009-7-4 16:49

  Powered by Discuz! 5.5.0 © 2001-2007 Comsenz Inc.
Processed in 0.060960 second(s), 3/3 queries

清除 Cookies - 联系我们 - ZDNetChina中文社区 - 无图版