Click to See Complete Forum and Search --> : Security - part two


rtatnell
07-13-2003, 09:14 AM
Ok, so I've decided to password protect my database. I can do the protecting bit in Access fine; but I have a problem when it comes to what I put in my SQL statements on my pages so that I can access the password protected information.

I need to ask for help in this department, as I've found it quite difficult to find any information on the web as to how I go out setting up my SQL. Some code would be greatly appreciated.

Thanks

Ribeyed
07-13-2003, 10:25 AM
Hi,
all you have to do for this is after the user logs in you set a session variable, i normally use:

session("LoggedInAs") = request.form("usename")


Then on every page you want secure do:


LoggedInAs = session("LoggedInAs")

if LoggedInAs = "" then
response.redirect "login.asp"
else

'display all the page here

end if


Hope this helps

rtatnell
07-13-2003, 11:37 AM
I dont know if you fully understand me. I want to password protect my database when I'm in MS Access using the Tools > Security > Set Database Password option, and then be able to get the record set etc properly from my database that's password protected. I get an error message usually if I try and access the data from the database when it's password protected, and I'd like to know the SQL code, or whatever, to work with my protected database on an ASP page.

Hope thats clearer, either that or u might need to explain what u've described a bit better; I'm a little bit green!

Thanks

Ribeyed
07-13-2003, 12:05 PM
Hi,
password protecting Access and password protecting your ASP page are 2 different things. I have answered how to configure access for password protection in your other post and i answered password protection for you ASP page in this post, what am i missing here?