<!--#include file="adovbs.inc" -->
<%
session("Name")=trim(request.form("UserName"))
session("PW")=trim(request.form("PassWord"))
DbPath = SERVER.MapPath("guestbook.mdb")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DbPath
set rs=server.createobject("adodb.recordset")
Sql="Select * from user where username='"&session("Name")&"' And password='"&session("PW")&"'"
rs.open Sql,conn,adopenkeyset,adlockoptimistic,adcmdtext
'set rs=conn.execute(Sql)
'response.write rs.recordCount
if rs.RecordCount<=0 then
response.redirect "UserLogin.asp"
else
session("username")=session("Name")
Select Case Request.Form("CookieDate")
Case 1
Response.Cookies(CookieDate).Expires=Date+1
Case 2
Response.Cookies(CookieDate).Expires=Date+31
Case 3
Response.Cookies(CookieDate).Expires=Date+365
End Select
response.redirect "manger.asp"
end if
%>