asp 修改表单提交问题,可以提交成功,就是不能更新数据库
主程序.asp
<%
if session("AdminName") = "" then
response.Redirect "Admin_Login.asp"
end if
%>
<!--#include file="CONN.ASP"-->
<!--#include file="Sql_Erro.asp"-->
<html>
<head>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<%
id=request("id")
Set rso=Server.CreateObject("ADODB.RecordSet")
sql="select * from bmxt where id="&id
rso.Open sql,conn,3,3
if rso.eof and rso.bof then
response.Write("没有数据记录!")
else
%>
<table align="center">
<form method="post" action="index_edit.asp?action=edit&id="<%=id%>>
<tr align="center" height="39">
<td>本人手机</td><td align="center" height="39"><input type="title" name="T7" maxlength=11 style="width:100px;" value="<%=rso("T7")%>"></td>
<td >常用QQ号</td><td align="center" height="39"><input type="title" name="T23" maxlength=15 style="width:100px;" value="<%=rso("T23")%>"></td></tr>
<td align="center" height="39" colspan="2"><input type="submit" value="我要修改!" name="submit"> </td>
</tr>
</table>
<% End If
rso.close
set rso=nothing
%>
</form>
</body>
</html>
《index_edit.asp》
<!--#include file="conn.asp"-->
<%
id=request("id")
%>
<%
if request("action") = "edit" then
id=request("id")
T7=request("T7")
T23=request("T23")
set rs=server.createobject("adodb.recordset")
sql="select * from bmxt where id="&id
rs.open sql,conn,1,3
rs("T7")=T7
rs("T23")=T23
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<script language='javascript'>" & chr(13)
response.write "alert('你的登记信息修改成功!');" & Chr(13)
response.write "window.document.location.href='Admin_Index.asp';"&Chr(13)
response.write "</script>" & Chr(13)
Response.End
else
response.write "<script language='javascript'>" & chr(13)
response.write "alert('你提交的参数有误!点击确定返回重新输入!');" & Chr(13)
response.write "window.document.location.href='Admin_Index.asp';"&Chr(13)
response.write "</script>" & Chr(13)
Response.End
end if
%>
------最佳解决方案--------------------发错版块了.也不要明知故犯,因为JSP的人很少有兴趣管你ASP的事.
<form method="post" action="index_edit.asp?action=edit&id="<%=id%>>
改成
<form method="post" action="index_edit.asp?action=edit&id=<%=id%>">
------其他解决方案--------------------哈哈 有才有才