asp高手进!ADODB.Field 错误 '800a0bcd' BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操
<!--#includefile="conn.asp"--><%ifsession("userid")=""thenresponse.Write"<scriptlangu...
<!-- #include file="conn.asp" -->
<%
if session("userid")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='clogin.asp';</script>"
response.redirect "clogin.asp"
response.end
end if
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>修改密码</title>
<style type="text/css">
<!--
body,td,th {
font-size:14px;
}
-->
</style>
</head>
<center>
<body>
<br>
<%
userid=session("userid")
pwd=session("pwd")
set rsc=server.CreateObject("adodb.recordset")
sqlc="select * from login where userid='"&userid&"' and pwd='"&pwd&"'"
rsc.open sqlc,conn,1,1
username=rsc("userid")
password=rsc("pwd")
rsc.close
set rsc=nothing
%>
<form name="form1" method="post" action="changer.asp?ac=ch">
<table width="39%" height="105" border="0">
<tr >
<td width="27%" height="30">用户名:</td>
<td width="73%" height="30"><input name="username" type="text" id="username" value="<%=username%>">
*</td>
</tr>
<tr>
<td height="30">密 码:</td>
<td height="30"><input name="password" type="text" id="password" value="<%=password%>">
*</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="修改"><a href="changer.asp?se=y" target="_self">退出系统</a></td>
<%
if strcomp(request.QueryString("se"),"y")=0 then
session("userid")=""
response.Write"<script language=javascript>opener=null;window.close();</script>"
end if
%>
</tr>
</table>
</form>
<%
if strcomp(request.QueryString("ac"),"ch")=0 then
set rs=server.CreateObject("adodb.recordset")
sql="select * from login where userid='"&userid&"' and pwd='"&pwd&"'"
rs.open sql,conn,1,3
rs("userid")=request.Form("username")
rs("pwd")=request.Form("password")
rs.update
rs.close
set rs=nothing
Session.Contents.Remove("userid")
Session.Contents.Remove("pwd")
Session("userid")=userid '把用户名写入session
Session("pwd")=pwd '把密码写入session
response.write "<script language=JavaScript>{window.alert('恭喜!修改成功!');window.history.go(-1);}</script>"
response.end
end if
%>
</body>
</center>
</html>
这是个用户名和密码修改页面,
不是登陆页面,怎么会出现"用户名密码错误"?????? 展开
<%
if session("userid")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='clogin.asp';</script>"
response.redirect "clogin.asp"
response.end
end if
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>修改密码</title>
<style type="text/css">
<!--
body,td,th {
font-size:14px;
}
-->
</style>
</head>
<center>
<body>
<br>
<%
userid=session("userid")
pwd=session("pwd")
set rsc=server.CreateObject("adodb.recordset")
sqlc="select * from login where userid='"&userid&"' and pwd='"&pwd&"'"
rsc.open sqlc,conn,1,1
username=rsc("userid")
password=rsc("pwd")
rsc.close
set rsc=nothing
%>
<form name="form1" method="post" action="changer.asp?ac=ch">
<table width="39%" height="105" border="0">
<tr >
<td width="27%" height="30">用户名:</td>
<td width="73%" height="30"><input name="username" type="text" id="username" value="<%=username%>">
*</td>
</tr>
<tr>
<td height="30">密 码:</td>
<td height="30"><input name="password" type="text" id="password" value="<%=password%>">
*</td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="修改"><a href="changer.asp?se=y" target="_self">退出系统</a></td>
<%
if strcomp(request.QueryString("se"),"y")=0 then
session("userid")=""
response.Write"<script language=javascript>opener=null;window.close();</script>"
end if
%>
</tr>
</table>
</form>
<%
if strcomp(request.QueryString("ac"),"ch")=0 then
set rs=server.CreateObject("adodb.recordset")
sql="select * from login where userid='"&userid&"' and pwd='"&pwd&"'"
rs.open sql,conn,1,3
rs("userid")=request.Form("username")
rs("pwd")=request.Form("password")
rs.update
rs.close
set rs=nothing
Session.Contents.Remove("userid")
Session.Contents.Remove("pwd")
Session("userid")=userid '把用户名写入session
Session("pwd")=pwd '把密码写入session
response.write "<script language=JavaScript>{window.alert('恭喜!修改成功!');window.history.go(-1);}</script>"
response.end
end if
%>
</body>
</center>
</html>
这是个用户名和密码修改页面,
不是登陆页面,怎么会出现"用户名密码错误"?????? 展开
3个回答
展开全部
试试:
<!-- #include file="conn.asp" -->
<%
if session("userid")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='clogin.asp';</script>"
response.redirect "clogin.asp"
response.end
end if
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>修改密码</title>
<style type="text/css">
<!--
body,td,th {
font-size:14px;
}
-->
</style>
</head>
<center>
<body>
<br>
<%
userid=session("userid")
pwd=session("pwd")
set rsc=server.CreateObject("adodb.recordset")
sqlc="select * from login where userid='"&userid&"' and pwd='"&pwd&"'"
rsc.open sqlc,conn,1,1
username=rsc("userid")
password=rsc("pwd")
rsc.close
set rsc=nothing
%>
<form name="form1" method="post" action="changer.asp?ac=ch">
<table width="39%" height="105" border="0">
<tr >
<td width="27%" height="30">用户名:</td>
<td width="73%" height="30"><input name="username" type="text" id="username" value="<%=username%>">
*<input type="hidden" name="userid" value="<%=password%>"></td>
</tr>
<tr>
<td height="30">密 码:</td>
<td height="30"><input name="password" type="text" id="password" value="<%=password%>">
*<input type="hidden" name="pwd" value="<%=password%>"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="修改"><a href="changer.asp?se=y" target="_self">退出系统</a></td>
<%
if strcomp(request.QueryString("se"),"y")=0 then
session("userid")=""
response.Write"<script language=javascript>opener=null;window.close();</script>"
end if
%>
</tr>
</table>
</form>
<%
if strcomp(request.QueryString("ac"),"ch")=0 then
set rs=server.CreateObject("adodb.recordset")
sql="select * from login where userid='"&request("userid")&"' and pwd='"&request("pwd")&"'"
rs.open sql,conn,1,3
if not rs.eof then
rs("userid")=request.Form("username")
rs("pwd")=request.Form("password")
rs.update
rs.close
set rs=nothing
Session.Contents.Remove("userid")
Session.Contents.Remove("pwd")
Session("userid")=request.Form("username") '把用户名写入session
Session("pwd")=request.Form("password") '把密码写入session
response.write "<script language=JavaScript>{window.alert('恭喜!修改成功!');window.history.go(-1);}</script>"
response.end
else
%>
<script language="javascript">
alert("用户名或密码错误!")
</script>
<%end if
end if
%>
</body>
</center>
</html>
<!-- #include file="conn.asp" -->
<%
if session("userid")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆!');window.location.href='clogin.asp';</script>"
response.redirect "clogin.asp"
response.end
end if
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>修改密码</title>
<style type="text/css">
<!--
body,td,th {
font-size:14px;
}
-->
</style>
</head>
<center>
<body>
<br>
<%
userid=session("userid")
pwd=session("pwd")
set rsc=server.CreateObject("adodb.recordset")
sqlc="select * from login where userid='"&userid&"' and pwd='"&pwd&"'"
rsc.open sqlc,conn,1,1
username=rsc("userid")
password=rsc("pwd")
rsc.close
set rsc=nothing
%>
<form name="form1" method="post" action="changer.asp?ac=ch">
<table width="39%" height="105" border="0">
<tr >
<td width="27%" height="30">用户名:</td>
<td width="73%" height="30"><input name="username" type="text" id="username" value="<%=username%>">
*<input type="hidden" name="userid" value="<%=password%>"></td>
</tr>
<tr>
<td height="30">密 码:</td>
<td height="30"><input name="password" type="text" id="password" value="<%=password%>">
*<input type="hidden" name="pwd" value="<%=password%>"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="修改"><a href="changer.asp?se=y" target="_self">退出系统</a></td>
<%
if strcomp(request.QueryString("se"),"y")=0 then
session("userid")=""
response.Write"<script language=javascript>opener=null;window.close();</script>"
end if
%>
</tr>
</table>
</form>
<%
if strcomp(request.QueryString("ac"),"ch")=0 then
set rs=server.CreateObject("adodb.recordset")
sql="select * from login where userid='"&request("userid")&"' and pwd='"&request("pwd")&"'"
rs.open sql,conn,1,3
if not rs.eof then
rs("userid")=request.Form("username")
rs("pwd")=request.Form("password")
rs.update
rs.close
set rs=nothing
Session.Contents.Remove("userid")
Session.Contents.Remove("pwd")
Session("userid")=request.Form("username") '把用户名写入session
Session("pwd")=request.Form("password") '把密码写入session
response.write "<script language=JavaScript>{window.alert('恭喜!修改成功!');window.history.go(-1);}</script>"
response.end
else
%>
<script language="javascript">
alert("用户名或密码错误!")
</script>
<%end if
end if
%>
</body>
</center>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
sql="select * from login where userid='"&userid&"' and pwd='"&pwd&"'" 这一行userid 的值为空,pwd的值也为空;应该在前边先把值获取过来。
在 if strcomp(request.QueryString("ac"),"ch")=0 then 的下边添上
userid=request.Form("username")
pwd=request.Form("password")
在 if strcomp(request.QueryString("ac"),"ch")=0 then 的下边添上
userid=request.Form("username")
pwd=request.Form("password")
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
userid=request.Form("username")'这里的用户名密码赋值错误,你密码已经改成了 request.Form("password") 它的值'
pwd=request.Form("password")
Session("userid")=userid '把用户名写入session
Session("pwd")=pwd '把密码写入session
pwd=request.Form("password")
Session("userid")=userid '把用户名写入session
Session("pwd")=pwd '把密码写入session
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询