Login Page

L

L

Is it possible for me to create a login page with an Access database to
verify the user name and password? I want the user to see a message and be
asked to re enter the information if it's not correct but if it's correct
then go to another page.
Is that possible?
 
M

Mike Mueller

Yes.

IIRC the MS Knowledge base has some articles on it

I have used this a little differently- here is how mine
works

Login.htm - form to gather username / password
Validate.asp - takes form info and executes SQL statement
against DB to check for a match, sets a session variable and
then redirects
Member.asp - the landing spot from validate, with links for
the members

all member pages are asp, with code at the top to check the
vaiable- if it does not match it redirects to login.htm





: Is it possible for me to create a login page with an
Access database to
: verify the user name and password? I want the user to see
a message and be
: asked to re enter the information if it's not correct but
if it's correct
: then go to another page.
: Is that possible?
 
L

L

I've tried the following code:
dim strUserName
dim strPassword
'
strUserName= Request.Form("txtUsername")
strPassword = Request.Form("txtPassword")
'
'Checks to make sure the username is not blank, if so then they must
re-enter their information.
if Trim(strUsername) = "" then
Response.redirect "VAR_Login.htm"
end if
'
'Checks to make sure the password is not blank, if so they they must
re-enter their information.
if Trim(strPassword) = "" then
Response.Redirect "VAR_Login.htm"
end if

'
'Checks to make sure the username is entered correctly. If so, the
InfoResource is then displayed.
if Trim(strUsername) <> "isis" then
Response.Redirect "VAR_Login.htm"
else
Response.Redirect "Isis_Var_InfoResource.htm"
end if

'Checks to make sure the password is entered correctly. If so, the
InfoResource is then displayed.
if Trim(strPassword) <> "Isis9009" then
Response.Redirect "VAR_Login.htm"
else
Response.Redirect "Isis_Var_InfoResource.htm"

But it only works with either 'isis' or 'Isis9009'. I want the combination.
ANy ideas?
 
M

MikeR

This is all you really need. You can do away with checking for blanks.

dim strUserName
dim strPassword
strUserName= Request.Form("txtUsername")
strPassword = Request.Form("txtPassword")

'Checks to make sure the username is entered correctly. If so, the
InfoResource is then displayed.
if (Trim(strUsername) <> "isis") and (Trim(strPassword) <> "Isis9009") then
Response.Redirect "VAR_Login.htm"
else
Response.Redirect "Isis_Var_InfoResource.htm"
end if

MikeR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top