国光帮帮忙 大哥,一个定单查询的问题,asp做的,哪位大哥能帮忙看下,100谢谢了

一个定单查询的问题,asp做的,哪位大哥能帮忙看下,100谢谢了 - 故障解答 - 电脑教程网

一个定单查询的问题,asp做的,哪位大哥能帮忙看下,100谢谢了

日期:2006-07-05   荐:
一个定单查询的问题,asp做的,哪位大哥能帮忙看下,100谢谢了错误类型:(0x80020009)发生意外。 /subuser.asp, 第 301 行浏览器类型:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon) 网页:GET /myuser.asp '//////////////////////////订单查讯sub dingdan()if request.cookies("bookshop")("username")="" thenresponse.Redirect "myuser.asp?action=login"response.Endend if%><table width="96%" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="55%"><div align="right"><font color="#FF6600">我 的 订 单</font></div></td> <td width="49%"><div align="right"> <select name="zhuangtai" onchange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" > <option value="myuser.asp?action=dingdan&zhuangtai=0" selected>--请选择查讯状态--</option> <option value="myuser.asp?action=dingdan&zhuangtai=0" >全部订单状态</option> <option value="myuser.asp?action=dingdan&zhuangtai=1" >未作任何处理</option> <option value="myuser.asp?action=dingdan&zhuangtai=2" >用户已经划出款</option> <option value="myuser.asp?action=dingdan&zhuangtai=3" >服务商已经收到款</option> <option value="myuser.asp?action=dingdan&zhuangtai=4" >服务商已经发货</option> <option value="myuser.asp?action=dingdan&zhuangtai=5" >用户已经收到货</option> </select> </div></td> </tr></table><table width="96%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">订单号</font></div></td> <td bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">合计金额</font></div></td> <td bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">收货人</font></div></td> <td bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">订货人</font></div></td> <td bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">付款方式</font></div></td> <td bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">收货方式</font></div></td> <td bgcolor="#5F95D3"><div align="center"><font color="#FFFFFF">订单状态</font></div></td> </tr> <%set rs=server.CreateObject("adodb.recordset") dim zhuangtai zhuangtai=request.QueryString("zhuangtai") if zhuangtai=0 or zhuangtai="" then select case zhuangtai case "0" rs.open "select distinct(dingdan),userzhenshiname,actiondate,shouhuoname,songhuofangshi,zhifufangshi,zhuangtai from shop_action where username='"&request.cookies("bookshop")("username")&"' and zhuangtai<6 order by actiondate desc",conn,1,1 case "" rs.open "select distinct(dingdan),userzhenshiname,actiondate,shouhuoname,songhuofangshi,zhifufangshi,zhuangtai from shop_action where username='"&request.cookies("bookshop")("username")&"' and zhuangtai<5 order by actiondate desc",conn,1,1 end select else rs.open "select distinct(dingdan),userzhenshiname,actiondate,shouhuoname,songhuofangshi,zhifufangshi,zhuangtai from shop_action where username='"&request.cookies("bookshop")("username")&"' and zhuangtai="&zhuangtai&" order by actiondate",conn,1,1 end if do while not rs.eof %> <tr> <td bgcolor="#EFF5FE"><div align="center"><a href=# onClick="javascript:window.open('dingdan.asp?dan=<%=trim(rs("dingdan"))%>','','width=710,height=388,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;"><%=trim(rs("dingdan"))%></a></div></td> <td bgcolor="#EFF5FE"><div align="center"><%dim ckxp,rs2'////判断送货方式要加收的金额set rs2=server.CreateObject("adodb.recordset")rs2.open "select * from shop_songhuo where songid="&rs("songhuofangshi"),conn,1,1set ckxp=server.CreateObject("adodb.recordset")ckxp.open "select distinct sum(zonger) as zonger from shop_action where dingdan='"&trim(rs("dingdan"))&"' group by dingdan ",conn,1,1-------------------第301行response.write "<font color=#FF6600>"&formatnumber(ckxp("zonger") rs2("jsmoney"),2)&"元</font>"ckxp.closeset ckxp=nothingrs2.closeset rs2=nothing%></div></td> <td bgcolor="#EFF5FE"><div align="center"><%=trim(rs("shouhuoname"))%></div></td> <td bgcolor="#EFF5FE"><div align="center"><%=trim(rs("userzhenshiname"))%></div></td> <td bgcolor="#EFF5FE"><div align="center"> <%set rs2=server.CreateObject("adodb.recordset") rs2.open "select * from shop_songhuo where songid="&rs("zhifufangshi"),conn,1,1 response.Write trim(rs2("subject")) rs2.close set rs2=nothing%> </div></td> <td bgcolor="#EFF5FE"><div align="center"> <%set rs2=server.CreateObject("adodb.recordset") rs2.open "select * from shop_songhuo where songid="&rs("songhuofangshi"),conn,1,1 response.Write trim(rs2("subject")) rs2.close set rs2=nothing %> </div></td> <td bgcolor="#EFF5FE"><div align="center"> <%select case rs("zhuangtai")case "1"response.write "未作任何处理"case "2"response.write "用户已经划出款"case "3"response.write "服务商已经收到款"case "4"response.write "服务商已经发货"case "5"response.write "用户已经收到货"end select%> </div></td> </tr> <% rs.movenext loop rs.close set rs=nothing%></table>distinct sum(zonger) 可以连着写的吗?301行是哪句??set rs2=server.CreateObject("adodb.recordset")rs2.open "select * from shop_songhuo where songid="&rs("songhuofangshi"),conn,1,1这句执行出来有没有问题?你可以先输出rs("dingdan")看一下,,,,301行那个语句是没有问题的,汗,楼上你怎么知道他的301是哪句??你没看他上面注明了的吗,,,,,'////判断送货方式要加收的金额set rs2=server.CreateObject("adodb.recordset")rs2.open "select * from shop_songhuo where songid="&rs("songhuofangshi"),conn,1,1set ckxp=server.CreateObject("adodb.recordset")ckxp.open "select distinct sum(zonger) as zonger from shop_action where dingdan='"&trim(rs("dingdan"))&"' group by dingdan ",conn,1,1-------------------第301行我感觉应该是sub dingdan()if request.cookies("bookshop")("username")="" thenresponse.Redirect "myuser.asp?action=login"response.Endend if中的问题,楼主栽好好的看看,页面跳转的参数是否全面?还有request.cookies("bookshop")("username")="" 我不知道这是什么?什么提示。有吗?全部提示消息是什么?另外,你换换游标和锁定方式看看!如果是SQL可以试试看看301有数据输出没!?另外看你的东西里ADO实在用得太乱,怎么这么多recordset啊!?对不起大家,我先看花了,把300行标成301行了,麻烦大家在帮忙看看我是刚学着用ASP的,这套程序是别人留下来的,我也不懂 set rs2=server.CreateObject("adodb.recordset")rs2.open "select * from shop_songhuo where songid="&rs ("songhuofangshi"),conn,1,1这句好象没什么问题,改了就报错了sub dingdan()if request.cookies("bookshop")("username")="" thenresponse.Redirect "myuser.asp?action=login"response.Endend if这里页面跳转的参数好象也是对的'////判断送货方式要加收的金额set rs2=server.CreateObject("adodb.recordset")rs2.open "select * from shop_songhuo where songid="&rs("songhuofangshi"),conn,1,1set ckxp=server.CreateObject("adodb.recordset")ckxp.open "select distinct sum(zonger) as zonger from shop_action where dingdan='"&trim(rs("dingdan"))&"' group by dingdan ",conn,1,1response.write "<font color=#FF6600>"&formatnumber(ckxp("zonger") rs2("jsmoney"),2)&"元</font>"---------------------------------------第301行ckxp.closeset ckxp=nothingrs2.closeset rs2=nothing%></This Wrongs is for your Database have no this Record.用isnull(sum(zoger),0) try你的: set rs2=server.CreateObject("adodb.recordset")rs2.open "select * from shop_songhuo where songid="&rs ("songhuofangshi"),conn,1,1这句好象没什么问题,改了就报错了改成下面的看看:If rs ("songhuofangshi")<>"" Then '判断一下读出来的送货方式是否为空set rs2=server.CreateObject("adodb.recordset")rs2.open "select * from shop_songhuo where songid="&rs ("songhuofangshi"),conn,1,1Elseresponse.end '没有定单end ifckxp.open "select distinct sum(zonger) as zonger from shop_action where dingdan='"&trim(rs("dingdan"))&"' group by dingdan ",conn,1,1-------------------凭感觉,这个SQL有语法错误,如果是access正确的应该是:select sum( distinctrow zonger) as zonger from shop_action where dingdan='"&trim(rs("dingdan"))&"' group by dingdan用查询分析一下看看做个宣传,斑竹高抬贵手别踢我呀:)学生XDJM申请PHP,asp空间,优惠!!静态空间10MB免费3个月!!心动不如行动.每年1元/MB!!!支持ASP,PHP,MySQL,ACCESS数据库.购买空间可获增值服务:1,赠送免费二级域名.2,在线免费技术问题解答.3,介绍新客户,可获得10MB空间赠送. 前提条件:1,不得上传违法内容;2,不得进行非法活动.3,不得违反互联网有关法律法规.联系方式:Tel :( 86)(755)83120050Fax :( 86)(755)83120050MoblePhone:( 86)(0)13480991703 HTTP://www.topwaysoft.comMSN/Email: [email protected] OICQ:331622229ckxp.open "select distinct sum(zonger) as zonger from shop_action where dingdan='"&trim(rs("dingdan"))&"' group by dingdan ",conn,1,1-------------------凭感觉,这个SQL有语法错误,如果是access正确的应该是:select sum( distinctrow zonger) as zonger from shop_action where dingdan='"&trim(rs("dingdan"))&"' group by dingdan用查询分析一下看看改了后报错错误类型:Microsoft JET Database Engine (0x80040E14)语法错误 (操作符丢失) 在查询表达式 'sum(distinctrow zonger)' 中。/subuser.asp, 第 300 行set rs2=server.CreateObject("adodb.recordset")rs2.open "select * from shop_songhuo where songid="&rs ("songhuofangshi"),conn,1,1这句好象没什么问题,改了就报错了改成下面的看看:If rs ("songhuofangshi")<>"" Then '判断一下读出来的送货方式是否为空set rs2=server.CreateObject("adodb.recordset")rs2.open "select * from shop_songhuo where songid="&rs ("songhuofangshi"),conn,1,1Elseresponse.end '没有定单end if改了后,错误还是原来的那1行response.write "<font color=#FF6600>"&formatnumber(ckxp("zonger") rs2("jsmoney"),2)&"元</font>"---------------------------------------第307行顶了。楼主你是用的《秋叶购物商城 v5.0 新春免费版》吧不知道,是我的前任留下来的,老板打算改版,但我发现这个问题自己又搞不定,只好拿上来看哪位大哥能帮我搞下
标签: