|
 |
access_asp thread: username and password for access database
Message #1 by "Ashley Gough" <ashleygough@h...> on Thu, 18 Jul 2002 10:23:17 +0000
|
|
hi
I want to have a username and password for an access database
I know access has a security option to enable a universal password to be
entered, but im looking for individual logins where work that person has
done on the database can be tracked using session variables or something.
I have looked at some books and Access help but they do not mention anything
about making your own login page.
Does anyone know of any good resources or has anyone done this before that
could give me some advice
Thankyou in advance
Ashley Rose
_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
Message #2 by "Carl E. Olsen" <carl-olsen@m...> on Thu, 18 Jul 2002 09:31:12 -0500
|
|
I use ASP and Javascript to create the login page, and ASP to prevent
anyone from seeing the data entry pages unless they have logged in
first.
Here is the code for the Logon.htm page:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?xml version="1.0" encoding="utf-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script language="javascript">
function form1_onsubmit()
{
var form = document.form1;
var returnValue = false;
if (form.txtUsername.value == "")
{
alert("Please enter your username");
form.txtUsername.focus();
}
else if (form.txtPassword.value == "");
{
alert("Please enter your password");
form.txtPassword.focus();
}
else
{
returnValue = true;
}
return returnValue;
}
</script>
</head>
<body>
<p>
To access this web page please enter your username and password in the
boxes below
</p>
<form action="CheckLogOn.asp" method="post" id="form1" name="form1"
onsubmit="return form1_onsubmit()">
<p>Username :
<input id="txtUsername" name="txtUsername" type="text" size="20" /></p>
<p>Password :
<input id="txtPassword" name="txtPassword" type="password" size="20"
/></p>
<p>
<input id="reset1" name="reset1" type="reset" value="Reset" />
<input id="submit1" name="submit1" type="submit" value="Log On" />
</p>
</form>
</body>
</html>
Here is the code for the CheckLogOn.asp page:
<%@ LANGUAGE = JavaScript%>
<%
if (Request.Form("txtUsername") == "Username" &&
Request.Form("txtPassword") == "Password")
{
Response.Cookies("IsValid") = "Yes";
Response.Redirect("http://webpages.com/dataentrypage.asp");
}
else
{
Response.Redirect("http://webpages.com/Logon.htm")
}
%>
Here is the code for the dataentrypage.asp page:
<%@ LANGUAGE = JavaScript%>
<%
if (Request.Cookies("IsValid") != "Yes")
{
Response.Redirect("Logon.htm")
}
%>
> -----Original Message-----
> From: Ashley Gough [mailto:ashleygough@h...]
> Sent: Thursday, July 18, 2002 5:23 AM
> To: Access ASP
> Subject: [access_asp] username and password for access database
>
> hi
>
> I want to have a username and password for an access database
> I know access has a security option to enable a universal password to
be
> entered, but im looking for individual logins where work that person
has
> done on the database can be tracked using session variables or
something.
> I have looked at some books and Access help but they do not mention
> anything
> about making your own login page.
> Does anyone know of any good resources or has anyone done this before
that
> could give me some advice
>
> Thankyou in advance
>
> Ashley Rose
>
>
>
>
> _________________________________________________________________
> Join the world's largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
> to unsubscribe send a blank email to leave-access_asp-
> 1112135Q@p...
Message #3 by "Larry Woods" <larry@l...> on Thu, 18 Jul 2002 08:11:49 -0700
|
|
Carl,
Good stuff. A little problem with the Javascript:
alert("Please enter your username");
form.txtUsername.focus();
}
else if (form.txtPassword.value == "");
{
alert("Please enter your password");
form.txtPassword.focus();
There is an extra ";" at the end of the "else if" statement.
Larry Woods
> -----Original Message-----
> From: Carl E. Olsen [mailto:carl-olsen@m...]
> Sent: Thursday, July 18, 2002 7:31 AM
> To: Access ASP
> Subject: [access_asp] RE: username and password for
> access database
>
>
> I use ASP and Javascript to create the login page, and
> ASP to prevent
> anyone from seeing the data entry pages unless they
> have logged in
> first.
>
> Here is the code for the Logon.htm page:
>
> <!DOCTYPE html
> PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <?xml version="1.0" encoding="utf-8" ?>
> <html xmlns="http://www.w3.org/1999/xhtml"
> xml:lang="en" lang="en">
> <head>
> <script language="javascript">
> function form1_onsubmit()
> {
> var form = document.form1;
> var returnValue = false;
> if (form.txtUsername.value == "")
> {
> alert("Please enter your username");
> form.txtUsername.focus();
> }
> else if (form.txtPassword.value == "");
> {
> alert("Please enter your password");
> form.txtPassword.focus();
> }
> else
> {
> returnValue = true;
> }
> return returnValue;
> }
> </script>
> </head>
> <body>
> <p>
> To access this web page please enter your username and
> password in the
> boxes below
> </p>
> <form action="CheckLogOn.asp" method="post" id="form1"
> name="form1"
> onsubmit="return form1_onsubmit()">
> <p>Username :
> <input id="txtUsername" name="txtUsername" type="text"
> size="20" /></p>
> <p>Password :
> <input id="txtPassword" name="txtPassword"
> type="password" size="20"
> /></p>
> <p>
> <input id="reset1" name="reset1" type="reset"
> value="Reset" />
> <input id="submit1" name="submit1" type="submit"
> value="Log On" />
> </p>
> </form>
> </body>
> </html>
>
> Here is the code for the CheckLogOn.asp page:
>
> <%@ LANGUAGE = JavaScript%>
> <%
> if (Request.Form("txtUsername") == "Username" &&
> Request.Form("txtPassword") == "Password")
> {
> Response.Cookies("IsValid") = "Yes";
> Response.Redirect("http://webpages.com/dataentrypage.asp");
> }
> else
> {
> Response.Redirect("http://webpages.com/Logon.htm")
> }
> %>
>
> Here is the code for the dataentrypage.asp page:
>
> <%@ LANGUAGE = JavaScript%>
>
> <%
> if (Request.Cookies("IsValid") != "Yes")
> {
> Response.Redirect("Logon.htm")
> }
> %>
>
> > -----Original Message-----
> > From: Ashley Gough [mailto:ashleygough@h...]
> > Sent: Thursday, July 18, 2002 5:23 AM
> > To: Access ASP
> > Subject: [access_asp] username and password for
> access database
> >
> > hi
> >
> > I want to have a username and password for an access database
> > I know access has a security option to enable a
> universal password to
> be
> > entered, but im looking for individual logins where
> work that person
> has
> > done on the database can be tracked using session
> variables or
> something.
> > I have looked at some books and Access help but they
> do not mention
> > anything
> > about making your own login page.
> > Does anyone know of any good resources or has anyone
> done this before
> that
> > could give me some advice
> >
> > Thankyou in advance
> >
> > Ashley Rose
> >
> >
> >
> >
> >
> _______________________________________________________
> __________
> > Join the world's largest e-mail service with MSN Hotmail.
> > http://www.hotmail.com
> >
> >
> to unsubscribe send a blank email to leave-access_asp-
> 1112135Q@p...
Message #4 by "Carl E. Olsen" <carl-olsen@m...> on Thu, 18 Jul 2002 14:03:09 -0500
|
|
Larry,
You are right. I don't know how that ";" got there. I'm not sure if
I'm still using that form. I just just grabbed the first copy I could
find. Thanks for pointing that out.
Carl Olsen, MCSE
http://carl-olsen.com/
> -----Original Message-----
> From: Larry Woods [mailto:larry@l...]
> Sent: Thursday, July 18, 2002 10:12 AM
> To: Access ASP
> Subject: [access_asp] RE: username and password for access database
>
> Carl,
>
> Good stuff. A little problem with the Javascript:
>
> alert("Please enter your username");
> form.txtUsername.focus();
> }
> else if (form.txtPassword.value == "");
> {
> alert("Please enter your password");
> form.txtPassword.focus();
>
> There is an extra ";" at the end of the "else if" statement.
>
> Larry Woods
>
>
> > -----Original Message-----
> > From: Carl E. Olsen [mailto:carl-olsen@m...]
> > Sent: Thursday, July 18, 2002 7:31 AM
> > To: Access ASP
> > Subject: [access_asp] RE: username and password for
> > access database
> >
> >
> > I use ASP and Javascript to create the login page, and
> > ASP to prevent
> > anyone from seeing the data entry pages unless they
> > have logged in
> > first.
> >
> > Here is the code for the Logon.htm page:
> >
> > <!DOCTYPE html
> > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> >
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > <?xml version="1.0" encoding="utf-8" ?>
> > <html xmlns="http://www.w3.org/1999/xhtml"
> > xml:lang="en" lang="en">
> > <head>
> > <script language="javascript">
> > function form1_onsubmit()
> > {
> > var form = document.form1;
> > var returnValue = false;
> > if (form.txtUsername.value == "")
> > {
> > alert("Please enter your username");
> > form.txtUsername.focus();
> > }
> > else if (form.txtPassword.value == "");
> > {
> > alert("Please enter your password");
> > form.txtPassword.focus();
> > }
> > else
> > {
> > returnValue = true;
> > }
> > return returnValue;
> > }
> > </script>
> > </head>
> > <body>
> > <p>
> > To access this web page please enter your username and
> > password in the
> > boxes below
> > </p>
> > <form action="CheckLogOn.asp" method="post" id="form1"
> > name="form1"
> > onsubmit="return form1_onsubmit()">
> > <p>Username :
> > <input id="txtUsername" name="txtUsername" type="text"
> > size="20" /></p>
> > <p>Password :
> > <input id="txtPassword" name="txtPassword"
> > type="password" size="20"
> > /></p>
> > <p>
> > <input id="reset1" name="reset1" type="reset"
> > value="Reset" />
> > <input id="submit1" name="submit1" type="submit"
> > value="Log On" />
> > </p>
> > </form>
> > </body>
> > </html>
> >
> > Here is the code for the CheckLogOn.asp page:
> >
> > <%@ LANGUAGE = JavaScript%>
> > <%
> > if (Request.Form("txtUsername") == "Username" &&
> > Request.Form("txtPassword") == "Password")
> > {
> > Response.Cookies("IsValid") = "Yes";
> > Response.Redirect("http://webpages.com/dataentrypage.asp");
> > }
> > else
> > {
> > Response.Redirect("http://webpages.com/Logon.htm")
> > }
> > %>
> >
> > Here is the code for the dataentrypage.asp page:
> >
> > <%@ LANGUAGE = JavaScript%>
> >
> > <%
> > if (Request.Cookies("IsValid") != "Yes")
> > {
> > Response.Redirect("Logon.htm")
> > }
> > %>
> >
> > > -----Original Message-----
> > > From: Ashley Gough [mailto:ashleygough@h...]
> > > Sent: Thursday, July 18, 2002 5:23 AM
> > > To: Access ASP
> > > Subject: [access_asp] username and password for
> > access database
> > >
> > > hi
> > >
> > > I want to have a username and password for an access database
> > > I know access has a security option to enable a
> > universal password to
> > be
> > > entered, but im looking for individual logins where
> > work that person
> > has
> > > done on the database can be tracked using session
> > variables or
> > something.
> > > I have looked at some books and Access help but they
> > do not mention
> > > anything
> > > about making your own login page.
> > > Does anyone know of any good resources or has anyone
> > done this before
> > that
> > > could give me some advice
> > >
> > > Thankyou in advance
> > >
> > > Ashley Rose
> > >
> > >
> > >
> > >
> > >
> > _______________________________________________________
> > __________
> > > Join the world's largest e-mail service with MSN Hotmail.
> > > http://www.hotmail.com
> > >
> > >
> > to unsubscribe send a blank email to leave-access_asp-
> > 1112135Q@p...
>
>
>
>
>
> to unsubscribe send a blank email to leave-access_asp-
> 1112135Q@p...
Message #5 by "Carl E. Olsen" <carl-olsen@m...> on Thu, 18 Jul 2002 14:12:10 -0500
|
|
Larry,
Actually, People have told me there's a JavaScript error on that page.
Maybe that extra ";" was causing the error. I use that script on
several web pages and I found the error in every one of them. I just
correct all of them, so I'll see if that stops the script error from
appearing. It obviously does not prevent the script from working.
Carl Olsen, MCSE
http://carl-olsen.com/
> -----Original Message-----
> From: Larry Woods [mailto:larry@l...]
> Sent: Thursday, July 18, 2002 10:12 AM
> To: Access ASP
> Subject: [access_asp] RE: username and password for access database
>
> Carl,
>
> Good stuff. A little problem with the Javascript:
>
> alert("Please enter your username");
> form.txtUsername.focus();
> }
> else if (form.txtPassword.value == "");
> {
> alert("Please enter your password");
> form.txtPassword.focus();
>
> There is an extra ";" at the end of the "else if" statement.
>
> Larry Woods
>
>
> > -----Original Message-----
> > From: Carl E. Olsen [mailto:carl-olsen@m...]
> > Sent: Thursday, July 18, 2002 7:31 AM
> > To: Access ASP
> > Subject: [access_asp] RE: username and password for
> > access database
> >
> >
> > I use ASP and Javascript to create the login page, and
> > ASP to prevent
> > anyone from seeing the data entry pages unless they
> > have logged in
> > first.
> >
> > Here is the code for the Logon.htm page:
> >
> > <!DOCTYPE html
> > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> >
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > <?xml version="1.0" encoding="utf-8" ?>
> > <html xmlns="http://www.w3.org/1999/xhtml"
> > xml:lang="en" lang="en">
> > <head>
> > <script language="javascript">
> > function form1_onsubmit()
> > {
> > var form = document.form1;
> > var returnValue = false;
> > if (form.txtUsername.value == "")
> > {
> > alert("Please enter your username");
> > form.txtUsername.focus();
> > }
> > else if (form.txtPassword.value == "");
> > {
> > alert("Please enter your password");
> > form.txtPassword.focus();
> > }
> > else
> > {
> > returnValue = true;
> > }
> > return returnValue;
> > }
> > </script>
> > </head>
> > <body>
> > <p>
> > To access this web page please enter your username and
> > password in the
> > boxes below
> > </p>
> > <form action="CheckLogOn.asp" method="post" id="form1"
> > name="form1"
> > onsubmit="return form1_onsubmit()">
> > <p>Username :
> > <input id="txtUsername" name="txtUsername" type="text"
> > size="20" /></p>
> > <p>Password :
> > <input id="txtPassword" name="txtPassword"
> > type="password" size="20"
> > /></p>
> > <p>
> > <input id="reset1" name="reset1" type="reset"
> > value="Reset" />
> > <input id="submit1" name="submit1" type="submit"
> > value="Log On" />
> > </p>
> > </form>
> > </body>
> > </html>
> >
> > Here is the code for the CheckLogOn.asp page:
> >
> > <%@ LANGUAGE = JavaScript%>
> > <%
> > if (Request.Form("txtUsername") == "Username" &&
> > Request.Form("txtPassword") == "Password")
> > {
> > Response.Cookies("IsValid") = "Yes";
> > Response.Redirect("http://webpages.com/dataentrypage.asp");
> > }
> > else
> > {
> > Response.Redirect("http://webpages.com/Logon.htm")
> > }
> > %>
> >
> > Here is the code for the dataentrypage.asp page:
> >
> > <%@ LANGUAGE = JavaScript%>
> >
> > <%
> > if (Request.Cookies("IsValid") != "Yes")
> > {
> > Response.Redirect("Logon.htm")
> > }
> > %>
> >
> > > -----Original Message-----
> > > From: Ashley Gough [mailto:ashleygough@h...]
> > > Sent: Thursday, July 18, 2002 5:23 AM
> > > To: Access ASP
> > > Subject: [access_asp] username and password for
> > access database
> > >
> > > hi
> > >
> > > I want to have a username and password for an access database
> > > I know access has a security option to enable a
> > universal password to
> > be
> > > entered, but im looking for individual logins where
> > work that person
> > has
> > > done on the database can be tracked using session
> > variables or
> > something.
> > > I have looked at some books and Access help but they
> > do not mention
> > > anything
> > > about making your own login page.
> > > Does anyone know of any good resources or has anyone
> > done this before
> > that
> > > could give me some advice
> > >
> > > Thankyou in advance
> > >
> > > Ashley Rose
> > >
> > >
> > >
> > >
> > >
> > _______________________________________________________
> > __________
> > > Join the world's largest e-mail service with MSN Hotmail.
> > > http://www.hotmail.com
> > >
> > >
> > to unsubscribe send a blank email to leave-access_asp-
> > 1112135Q@p...
>
>
>
>
>
> to unsubscribe send a blank email to leave-access_asp-
> 1112135Q@p...
|
|
 |