请高人看下这段ASP代码的错误
用处:实现退单功能~然后把预先预定的钱退还给客户~setrs=server.createobject("adodb.recordset")sql="select*from...
用处:实现退单功能~然后把预先预定的钱退还给客户~
set rs=server.createobject("adodb.recordset")
sql="select * from dinggou where id="&Request.QueryString("id")&"
rs.open sql,conn,1,3
amount=rs("amount")
username=rs("username")
rs.close
set rs=server.createobject("adodb.recordset")
sql="select * from member where username='"&username&"'"
rs.open sql,conn,1,3
rs("money")=rs("money")+cdbl(amount)
rs.update
rs.close
set rs=nothing
conn.execute ("update dinggou set zhuangtai='已退单' where id="&Request.QueryString("id")&"")
response.Write "<script language=javascript>alert('退单成功!');window.close();window.opener.location.reload()</script>"
response.end 展开
set rs=server.createobject("adodb.recordset")
sql="select * from dinggou where id="&Request.QueryString("id")&"
rs.open sql,conn,1,3
amount=rs("amount")
username=rs("username")
rs.close
set rs=server.createobject("adodb.recordset")
sql="select * from member where username='"&username&"'"
rs.open sql,conn,1,3
rs("money")=rs("money")+cdbl(amount)
rs.update
rs.close
set rs=nothing
conn.execute ("update dinggou set zhuangtai='已退单' where id="&Request.QueryString("id")&"")
response.Write "<script language=javascript>alert('退单成功!');window.close();window.opener.location.reload()</script>"
response.end 展开
1个回答
展开全部
<%
set rs=server.createobject("adodb.recordset")
sql="select * from dinggou where id="&Request.QueryString("id")&""
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.Write "<script language=javascript>alert('订单不存在!');history.go(-1);</script>"
response.end
else
amount=rs("amount")
username=rs("username")
set rs=server.createobject("adodb.recordset")
sql="select * from member where username='"&username&"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
else
rs("money")=rs("money")+Cint(amount)
rs.update
conn.execute ("update dinggou set zhuangtai='已退单' where id="&Request.QueryString("id")&"")
end if
response.Write "<script language=javascript>alert('退单成功!');window.close();window.opener.location.reload()</script>"
response.end
end if
%>
set rs=server.createobject("adodb.recordset")
sql="select * from dinggou where id="&Request.QueryString("id")&""
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.Write "<script language=javascript>alert('订单不存在!');history.go(-1);</script>"
response.end
else
amount=rs("amount")
username=rs("username")
set rs=server.createobject("adodb.recordset")
sql="select * from member where username='"&username&"'"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
else
rs("money")=rs("money")+Cint(amount)
rs.update
conn.execute ("update dinggou set zhuangtai='已退单' where id="&Request.QueryString("id")&"")
end if
response.Write "<script language=javascript>alert('退单成功!');window.close();window.opener.location.reload()</script>"
response.end
end if
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询