<%
dim conn
set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "DSN=localserver;uid=sa;pwd=;database=database"
conn.open
Set cmd= Server.CreateObject("ADODB.Command")
Set cmd.ActiveConnection = conn
UserName = Request.Form("UserName")
PassWord = Request.Form("PassWord")
If UserName = Empty or PassWord = Empty Then
Response.Write"用户名或密码不能为空!!"
Response.End
Else
sql="select * from xs "
Set rs = Server.CreateObject("ADODB.recordset")
rs.open sql,conn
if rs("UserName")=ZH and rs("PassWord")=MM then
response.redirect "index.asp"
else
response.write"用户名或密码输入错误,请确认!!"
End If
End If
rs.Close
Set rs = Nothing
%>