asp 对象关闭时,不允许操作.

<%username=Request.Form("username")passwordold=Request.Form("passwordold")passwordnew... <%
username=Request.Form("username")
passwordold=Request.Form("passwordold")
passwordnew=Request.Form("passwordnew")
if username <> "" and passwordold <> "" and passwordnew <> "" then
set rs1 = Server.CreateObject("ADODB.recordSet")
sql1 = "select * from users where username='"&username&"' and password='"&passwordold&"'"
rs1.open sql1,conn,1,1
if rs1.recordcount = 1 then
set rs = Server.CreateObject("ADODB.recordSet")
sql = "update users set password='"&passwordnew&"' where username='"&username&"'"
rs.open sql,conn,1,1
if rs.recordcount = 1 then
Response.Redirect("pwd.asp")
Response.End()
rs.close
set rs=nothing
end if
else
response.write"密码输入错误"
end if

end if
%>
错误在第26行 if rs.recordcount = 1 then,但是查看数据也执行了,请问怎么处理,谢谢!
展开
 我来答
草由八三十
2018-04-02 · TA获得超过206个赞
知道小有建树答主
回答量:313
采纳率:89%
帮助的人:114万
展开全部
<%
username=Request.Form("username")
passwordold=Request.Form("passwordold")
passwordnew=Request.Form("passwordnew")
if username <> "" and passwordold <> "" and passwordnew <> "" then
set rs1 = Server.CreateObject("ADODB.recordSet")
sql1 = "select * from users where username='"&username&"' and password='"&passwordold&"'"
rs1.open sql1,conn,1,1
if rs1.recordcount = 1 then
set rs = Server.CreateObject("ADODB.recordSet")
sql = "update users set password='"&passwordnew&"' where username='"&username&"'"
rs.open sql,conn,1,1
if rs.recordcount = 1 then
Response.Redirect("pwd.asp")
Response.End()
else
response.write"密码输入错误"
end if
end if
rs.close
set rs=nothing
rs1.close
set rs1=nothing
end if
%>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式