asp 表单不能提交修改
修改数据库代码:<%dimOrderNum,IDOrderNum=trim(request("OrderNum"))ifRequest.QueryString("acti...
修改数据库代码:
<%
dim OrderNum,ID
OrderNum=trim(request("OrderNum"))
if Request.QueryString("action")="southidc" then
id=trim(request("id"))
price=request.form("price")
Set rs_save = Server.CreateObject("ADODB.Recordset")
rs_save.open "select * from OrderDetail where ID='" &ID& "'",conn,1,3
conn.execute sql
rs_save("BuyPrice")=price
rs_save.update
rs_save.close
set rs_flag=server.createobject("adodb.recordset")
sqltext="Update OrderList set Flag='Yes' where OrderNum='"&OrderNum&"'"
rs_flag.open sqltext,conn,1,3
rs_flag.close
'response.redirect "Admin_OrderDetail.asp?OrderNum='"&OrderNum&"'"
end if
表单提交代码:
<form name="form" method="post" action="Admin_OrderDetail.asp?action=southidc&id=<%=rs2("id")%>">
<tr>
<td height="22" align="center"><%=rs2("Title")%></td>
<td height="22" align="center"><input name="Price" type="text" id="Price" size="10" value=<%=rs2("BuyPrice")%> 元</td>
<td height="22" align="center"><input type="submit" name="Submit" value="修 改"></td>
</tr>
<INPUT TYPE="hidden" name="OrderNum" value="<%=OrderNum%>">
</form> 展开
<%
dim OrderNum,ID
OrderNum=trim(request("OrderNum"))
if Request.QueryString("action")="southidc" then
id=trim(request("id"))
price=request.form("price")
Set rs_save = Server.CreateObject("ADODB.Recordset")
rs_save.open "select * from OrderDetail where ID='" &ID& "'",conn,1,3
conn.execute sql
rs_save("BuyPrice")=price
rs_save.update
rs_save.close
set rs_flag=server.createobject("adodb.recordset")
sqltext="Update OrderList set Flag='Yes' where OrderNum='"&OrderNum&"'"
rs_flag.open sqltext,conn,1,3
rs_flag.close
'response.redirect "Admin_OrderDetail.asp?OrderNum='"&OrderNum&"'"
end if
表单提交代码:
<form name="form" method="post" action="Admin_OrderDetail.asp?action=southidc&id=<%=rs2("id")%>">
<tr>
<td height="22" align="center"><%=rs2("Title")%></td>
<td height="22" align="center"><input name="Price" type="text" id="Price" size="10" value=<%=rs2("BuyPrice")%> 元</td>
<td height="22" align="center"><input type="submit" name="Submit" value="修 改"></td>
</tr>
<INPUT TYPE="hidden" name="OrderNum" value="<%=OrderNum%>">
</form> 展开
3个回答
展开全部
where ID='" &ID& "'
看下你的id是文本还是数字类型
where ID=" &ID '数字类型应这样
看下你的id是文本还是数字类型
where ID=" &ID '数字类型应这样
追问
ID是自动编号啊,应该是数字吧
追答
应该是数字
rs_save.open "select * from OrderDetail where ID=" &ID,conn,1,3
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<%
dim OrderNum,ID
OrderNum=trim(request.Form("OrderNum"))
if Request.QueryString("action")="southidc" then
id = trim(request.QueryString("id"))
price = request.form("price")
Set rs_save = Server.CreateObject("ADODB.Recordset")
rs_save.open "select ID, BuyPrice from OrderDetail where ID = " & ID,conn,1,3
rs_save(1)=price
rs_save.update
rs_save.close()
Set rs_save = nothing
conn.execute("Update OrderList set Flag='Yes' where OrderNum=" & OrderNum)
'response.redirect "Admin_OrderDetail.asp?OrderNum='"&OrderNum&"'"
end if
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
action提交地址对吗
更多追问追答
追问
action提交地址是对的啊
追答
那你就简单点,在提交的页面随便打印个东西,看提交过去没
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询