How do I create a username and password using a form?

  • Thread starter Thread starter Kittenn16
  • Start date Start date
K

Kittenn16

Hi, i'm an A level student and I need to know how to create a username and
password using a form if it is possiable. My teacher says that we are not
allowed to use the build in password to the database. If you know how to
create on please message back.
 
Kittenn16 said:
Hi, i'm an A level student and I need to know how to create a username and
password using a form if it is possiable. My teacher says that we are not
allowed to use the build in password to the database. If you know how to
create on please message back.

Yes you can but it's security merits will be low. Thy this (untested):

Create a table with username and password (text) fields. Enter and save a
username and password.

Bind a form to your new table and include text boxes bound to your fields.
Call your password text box "txtPassword". Add an unbound text box and call
it "txtInput". Set the input mask for "txtInput" to "password" - so that
"*" will be displayed when you enter data. Add a command button to your
form and put this code in its Click event:

If Me.txtInput <> Me.txtPassword Then
MsgBox "Access denied"
Else
'Do other stuff
End If

Open the form in run-time and enter your username and an incorrect
password - you should get an "Access denied" message. You'd need to add
similar code to test the username control too.

This is very rough and ready and you'd probably also want to make
"txtPassword" not visible but hopefully you get the idea.

HTH - Keith.
www.keithwilby.com
 
The CreateUser method will create a new user. Broadly speaking, all you
need to do is to create a form with textboxes for the new user-name and
other relevent information. Then have a button labelled Create User,
whose OnClick event runs the CreateUser method, passing the details
from the textboxes. Some googling should easily find examples of using
CreateUser.

HTH,
TC
 
Back
Top