<%@ Language=VBScript %> <%Response.Buffer=true%> <% Dim conn,rs,strsql set conn = server.CreateObject("ADODB.Connection") set rs = server.CreateObject("ADODB.Recordset") 'DSN less connection conn.Provider = "Microsoft.Jet.OLEDB.4.0" conn.ConnectionString = "Data Source=" & Server.MapPath("login.mdb") conn.open strsql = "Select Username, Password From Login where Username = '" & _ Request.Form("txtusername") & "' and Password = '" & _ Request.Form("txtpassword") & "'" set rs = conn.Execute (strsql) If (not rs.BOF) and (not rs.EOF) then Response.Cookies("Username") = rs.Fields("Username") Response.Redirect "http://www.yourwebsite.com/yourentrypage.html" else Response.Redirect "http://www.yourwebsite.com/access-denied-page.html" end if 'close the recordset rs.close set rs = nothing 'close the connection conn.close set conn = nothing