ASP+Access user login code, of which
huiyuan.mdb database name
PUSER213 table name
Y_Username user list, y_password password field.
login.htm page
<head>
<metahttp-Equiv = Content-Typecontent = Text/HTML; Charset = GB2312>
<Title> Login </Title>
</head>
<body>
<p> </p>
<FORMNAME = FORM1Method = PostAction = Loginnew.asp>
<TableWidth = 200BORDER = 1ALIGN = CenterCellpadding = 0cellspacing = 0>
<tr>
<tdcolspan = 2> <divalign = Center> Login </div> </td>
</tr>
<tr>
<tdwidth = 57> <divalign = center> Username </div> </td>
<tdwidth = 137Valign = Top> <inputname = UsernameType = Text
id = usernamesize = 25> </td>
</tr>
<tr>
<TD> <divalign = Center> Password </div> </td>
<tdvalign = Top> <inputName = PasswordType = Password
ID = passwordsize = 25> </td>
</tr>
<tr>
<tdcolspan = 2> <divalign = Center>
<inputtype = submitname = submitValue = Submit>
</div> </td>
</tr>
</table>
</form>
</body>
</html>
loginnew.asp webpage
<%
DIMUSERNAME, PASSWORD
username = request.form (username)
password = request.form (password)
setrs = server.createObject (Adodb.oldSet)
conn = dbq =+server.mappath (huiyuan.mdb)+; defaultdir =;
Driver = {MicrosoftaccessDriver (*. MDB)};
SQL = Select*Frombuser213wherey_username = '& Username &'
RS.OPENSQL, CONN, 1,1
ifrs.eofthen
response.write <script> Alert ('Log in Login Fail "; History.back (); </script>
response.end
else
ifRS (Y_PASSWORD) <> Passwordthen
response.write <script> Alert ('Log in Login Fail "; History.back (); </script>
response.end
endif
session (admin) = username
response.write <script> Alert ('Login Success'); local.href = 'Index.asp' </script>
endif
%>