登陆错误
<%Set Con=Server.CreateObject("ADODB.Connection")
con.open"driver={microsoft access driver (*.mdb)};dbq="&server.mappath("注册.mdb")
Set Rs=Server.CreateObject("ADODB.Recordset")
action=trim(Request("action"))
UserCount=trim(Request("UserCount"))
Password=trim(Request("Password"))
if action="login" then checkpass=true
if len(UserCount)<1 then checkpass=false
if len(Password)<1 then checkpass=false
if checkpass then
query="select UserCount, UserPasswd from zhuce where UserCount='"
query=query+UserCount+"'"
Rs.Open query,Con,3,2
If (Not Rs.EOF) Then
if (Rs("UserPasswd") = Password) then
checkpass=true
else
checkpass=false
end if
Else
checkpass=false
End If
end if
if checkpass then
response.redirect "注册.asp"
else
response.write "登陆失败"
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>用户登入</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.style1 {color: #0000cc}
-->
</style>
</head>
<body>
<form action="login.asp*" method="post">
<input type="hidden" name="action" value="login">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="ffffff" bgcolor="#99ccFF">
<tr>
<td width="20%"><span class="style1">用户帐号</span></td>
<td width="80%"><input type="text" name="Nickname">*</td>
</tr>
<tr>
<td width="20%"><span class="style1">用户密码</span></td>
<td width="80%"><input type="password" name="Password">*</td>
</tr>
<tr>
<td width="20%">
<span class="style1">操作</span>
</td>
<td width="80%">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Reset" value="重置">
</td>
</tr>
</table>
</form>
</body>
</html>
为什么在运行时总是先出现登陆错误呢?然后再出现表格,改怎么办好?