Thank you, this solved my problem with accessing the database. However, the URL is returned incorrectly, so that the visitor is not returned to the restricted page that they were trying to access. I think the error is here:<BR><BR>Response.Redirect "/login.asp?" & Server.URLEncode(Request.ServerVariables("SCRIPT_N AME")) <BR><BR>I have also tried: <BR><BR>Response.Redirect("/login.asp?redir=" & Server.URLEncode(Request.ServerVariables("SCRIPT_N AME") & "?" & Request.QueryString)) BUT I get an invalid URL error.<BR><BR>How can I save the URL correctly?<BR><BR>This is what I get: %2Fstudynotes%2Fstudynotes%2Easp<BR><BR>I am not a good programmer, so any help is greatly appreciated.<BR>Thanks In Advance.