自学ASP半月,写了个程序,错误
本程序是为了寻找丢失的密码,运行提交第一次时运行不了,为什么,请各位帮忙<% @ language=vbscript %>
<%
response.buffer=true
on error resume next
If Request.ServerVariables("REQUEST_METHOD")="GET" Then
%>
<form action="密码.asp" method="post">
请输入帐号:
<input type="text" name="nam">
<input type="submit" name="B" value="查找">
</form>
<%
response.End
else response.Clear
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq= " & server.mappath("用户.mdb")
set rs=server.createobject("abodb.recordset")
rs.open "zhuce",conn,1,3
action=trim(request(action))
if action="acton" then
rs.movefirst
realnam=trim(request("realnam"))
while Not rs.eof
if realnam=rs("UserName") then
checker=true
end if
rs.movenext
wend
if checker then
response.write("你的密码为"+rs("Userpasswd"))
else
response.write("输入错误")
response.redirect("密码.asp")
end if
else
nam=trim(request("nam"))
while Not rs.Eof
if nam=rs("UserCount") then
check=true
end if
rs.movenext
wend
end if
if check then
%>
<form action="密码.asp" method="post">
<input type="hidden" name="action" value="acton">
请输入你的真实姓名:
<input type="text" name="realnam">
<input type="submit" name="B1" value="查找">
</form>
<%
else
response.write("输入错误")
response.redirect("密码.asp")
end if
end if
end if
%>
[此贴子已经被作者于2007-10-8 0:40:05编辑过]