Generate set of Passwords in Access

Anonymous
2011-06-21T06:23:05+00:00

I ha ve an access database that contains the following columns :

UserID |First name  | Last Name | Username

I would like to add a password column as well and generate random passwords for the number of records found in my database , example if I have 50 records then I need to generate 50 password , 1 for every record

Any idea ?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2011-06-23T16:58:46+00:00

What are the better ways ?

 

As suggested upthread, include both a Password field and a date/time field PasswordExpires. When you create a new user give them a password that's really easy - "password" for example! - and set the PasswordExpires field to =Date().

Then in your logon process check the expiration date. If it's less than or equal to Date() make them assign a new password of their own choice. You can enforce "strong" passwords by (say) ensuring that their entry is of mixed case or contains at least one number:

Dim blnPwdOk As Boolean

If StrComp([txtPassword], LCase([txtPassword]), 0) = 0 Then

  MsgBox "Password must contain at least one uppercase letter", vbOKOnly

  blnPwdOk = False

Elseif StrComp([txtPassword], UCase([txtPassword]), 0) = 0 Then

  MsgBox "Password must contain at least one lowercase letter", vbOKOnly

  BlnPwdOk = False

< use Instr to check for digits and/or special characters >

You may also want to set the PasswordExpires field to some date (say three months in the future) after you update the password.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

15 additional answers

Sort by: Newest
  1. Anonymous
    2011-06-23T07:27:48+00:00

    I want to assign 1218 different passwords to 1218 records currently in the table Please

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2011-06-23T05:15:28+00:00

    I presume you mean "all the records in the table" not "all the fields in the database". You don't want First Name replaced by 6K[wQ-F do you?

    And if you want to update all records in this table to enter a random password in the Password field, what's the relevance of the form, or of the record currently displayed on the form? You might have a record for Erika Daniels displayed on the screen; do you want a password just for her, or do you want to assign 1218 different passwords to the 1218 records currently in the table?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-06-23T05:08:22+00:00

    Lets say I have a table in the database that contains the below fields :

    UserID |First name  | Last Name | Username |Password

    All the fields are filled with data except for the password that is blank

    what i want is when I click a button on the form it will generate passwords for all the fields in the database

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2011-06-22T13:42:48+00:00

    Button?  What button?  And what is the code you are using for the button?  And WHERE is the button (hopefully on a form and NOT in a report).

    Also describe what you want the button to do.  For instance, when I click the button I want to generate a password and assign the value to a control on my form and when the record attached to the form is saved, I want the value saved into a field.

    Was this answer helpful?

    0 comments No comments