假设数据库连接文件在conn.asp中
<!--#include file="conn.asp"-->
<%
set rs=conn.execute("select * from user where username='xxx' and password='xxx'")
If rs.eof and rs.bof Then
Response.write "用户名或密码错误!"
Response.End
Else
logined=true
Response.write "您已经成功登陆!"
Response.Redirect "index.asp"
End If
%>