ADODB.Recordset 错误 '800a0bcd' BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

hy3224546 2008-11-04 05:00:08
<%
if not session("check")="checked" then
response.Redirect "login.asp"
else
%>
<!--#include file="conn.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from admin"
rs.open sql,conn,1,1
%>
<%
if request.querystring("act")="xg" then
sql1="select * from admin where username='"&username&"'"
else
sql1="select * from admin"
end if
set rs1=server.CreateObject("adodb.recordset")
rs1.open sql1,conn,1,3
%>
<%
if request.querystring("act")="xg" then
rs1("username")=request.form("username")
rs1("password")=request.form("password")
rs1.update
rs1.close
response.Write "修改完成,请执行其他操作"
else
%>

<style type="text/css">
<!--
body {
background-color: #000000;color:#FFF;
}
-->
</style><form name="form1" method="post" action="pass.asp?act=xg">
<div align="center"></div>
<label>
<div align="center">用户名:
<input type="text" name="username" value="">
</div>
</label>
<p align="center">新密码:
<label>
<input type="text" name="password" value="">
</label>
</p>
<p align="center">
<label>
<input type="submit" name="Submit" value="确认修改">
</label>
<label>
<input type="reset" name="Submit2" value="重置">
</label>
</p>

</form>
<%
end if
rs.close
conn.close
set rs=nothing
set rs1=nothing
set conn=nothing
%>
<%
end if
%>


/898989/admin/pass.asp,行 23


请帮忙修改一下,谢谢!~~
...全文
218 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hick008 2008-11-04
  • 打赏
  • 举报
回复
编辑数据库
-晴天 2008-11-04
  • 打赏
  • 举报
回复
程序逻辑都没通!
你要修改什么?用户名和密码?原来的用户名和原来的密码写在哪里?没有原来的用户名和密码,就能随便修改admin的用户名和密码了吗?!
virgo2008 2008-11-04
  • 打赏
  • 举报
回复

<!--#include file="conn.asp"-->
<%
if session("check")<>"checked" then
response.Redirect "login.asp"
response.End()
end if

username=request.form("username")
password=request.Form("password")
if Request.Form("Submit")="确认修改" then
sql="select * from admin where username='"&username&"'"
else
sql="select * from admin"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
rs("username")=username
rs("password")=password
rs.update
rs.close
response.Write "修改完成,请执行其他操作"
response.End()
else
Response.Write "用户名错误"
response.End()
end if
%>

<style type="text/css">
<!--
body {
background-color: #000000;color:#FFF;
}
-->
</style> <form name="form1" method="post" action="pass.asp?act=xg">
<div align="center"> </div>
<label>
<div align="center">用户名:
<input type="text" name="username" value="">
</div>
</label>
<p align="center">新密码:
<label>
<input type="text" name="password" value="">
</label>
</p>
<p align="center">
<label>
<input type="submit" name="Submit" value="确认修改">
</label>
<label>
<input type="reset" name="Submit2" value="重置">
</label>
</p>

</form>
<%
rs.close
conn.close
set rs=nothing
set conn=nothing
%>


我没有测试 不好意思,不过你可以根据你if 的数据来判断哪多了咯 楼主 ,不会想要现成的把
hy3224546 2008-11-04
  • 打赏
  • 举报
回复
楼上的修改的还是有错误..现在提示别的错误了,

Microsoft VBScript 编译器错误 错误 '800a0400'

缺少语句

/898989/admin/pass.asp,行 59

end if
^
virgo2008 2008-11-04
  • 打赏
  • 举报
回复

<!--#include file="conn.asp"-->
<%
if session("check")<>"checked" then
response.Redirect "login.asp"
response.End()
end if

username=request.form("username")
password=request.Form("password")
if Request.Form("Submit")="确认修改" then
sql="select * from admin where username='"&username&"'"
else
sql="select * from admin"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
rs("username")=username
rs("password")=password
rs.update
rs.close
response.Write "修改完成,请执行其他操作"
response.End()
else
Response.Write "用户名错误"
response.End()
end if
%>

<style type="text/css">
<!--
body {
background-color: #000000;color:#FFF;
}
-->
</style> <form name="form1" method="post" action="pass.asp?act=xg">
<div align="center"> </div>
<label>
<div align="center">用户名:
<input type="text" name="username" value="">
</div>
</label>
<p align="center">新密码:
<label>
<input type="text" name="password" value="">
</label>
</p>
<p align="center">
<label>
<input type="submit" name="Submit" value="确认修改">
</label>
<label>
<input type="reset" name="Submit2" value="重置">
</label>
</p>

</form>
<%
end if
rs.close
conn.close
set rs=nothing
set rs1=nothing
set conn=nothing
%>
<%
end if
%>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧