标题:[求助]ADODB.Recordset (0x800A0BCD)
只看楼主
PeriCHR
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-10-3
 问题点数:0 回复次数:0 
[求助]ADODB.Recordset (0x800A0BCD)

错误类型:
ADODB.Recordset (0x800A0BCD)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
/check.asp, 第 110 行

可是,那个位置明明有记录的……同样的查询在别的地方就可以查到……


110行: rs("u_password") = pass3

以下为97-119行

Case "ChangePassword"
Call CheckRoot()
pass2=md5_net(replace(trim(request.form("pass2")),"'",""))
pass3=md5_net(replace(trim(request.form("pass3")),"'",""))
If pass2<>pass3 Then
response.write "<script type='text/javascript'>alert('New Password are not the same!');"
response.write "this.location.href='vbscript:history.back()';</script>"
response.End
End If
set rs=server.createobject("adodb.recordset")
sql="select * from admin where u_name='"&username&"'"
rs.open sql,conn,1,3
If rs.bof and rs.eof Then
rs("u_password") = pass3
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write "<script type='text/javascript'>alert('密码修改成功!');"
response.write "this.location.href='index.asp';</script>"
response.End
End If


代码中使用了CheckRoot()的模块。以下为CheckRoot()内容:

Function CheckRoot()
username=replace(trim(request.form("username")),"'","")
password=md5_net(replace(trim(request.form("password")),"'",""))
set rs=server.createobject("adodb.recordset")
sql="select * from admin where u_name='"&username&"'"
rs.open sql,conn,1,1
If rs.bof and rs.eof Then
response.write "<script type='text/javascript'>alert('Username or Passward is not valid!');"
response.write "this.location.href='vbscript:history.back()';</script>"
response.End
Else If rs("u_password")<>password Then
response.write "<script type='text/javascript'>alert('Username or Passward is not valid!');"
response.write "this.location.href='vbscript:history.back()';</script>"
response.End
End If
End If
End function

都是“rs("u_password") ”,在CheckRoot()里面就可以通过……为什么到后面就说记录不存在呢?

搜索更多相关主题的帖子: Recordset ADODB 
2006-10-03 15:48



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-94081-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.303335 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved