DCount on a password field

branston

Registered User.
Local time
Today, 20:28
Joined
Apr 29, 2009
Messages
372
Hi,

I have a table with fields Name, Password and then various yes/no fields which say what they are permitted to do.
I am trying to write some code which looks in that table, filters for all the records where a specific yes/no field is true (i.e. all the users that have permission to enter area A). I then put this into another table - LkUpTblNamePassStore .
This part works fine.

I then want the user to enter their password, and if that password is in the temporary table i want it to output OK (for now), if it isnt i want to output Error. I was thinking i could do it with a dcount. this is what i have so far:

strPass = Inputbox("Please Enter your Password", "PASSWORD", , 6500, 6500)
If Nz(DCount("Name", "LkUpTblNamesPassStore", "[Password] = '" & strPass & "'"), 0) = 0 Then
MsgBox "Password Error"
Else
MsgBox "OK"
End If

But it doesnt work, whatever i put in as the password it comes up with an error

Any ideas of why, or another way round it?

Thankyou!

ON FURTHER TESTING:
I have found that its because the passwords are stored in the table as a password field, i.e. they are shown as *'s. If i put in the password as the correct number of *'s it works. Obviously this isnt going to work! Is there a way round it without making the passwords visible in the table?
 
Last edited:
Hi,

Why are you dealing with security in this way, if you want your users to have specific access to specific parts of your database, why don't you use Access's security! You can find this under Tools\Security

Under this you will find the following functionalities;

Set Database Password
User And Group Permissions [This is the one I believe you need]
User And Group Accounts
User Level Security_Wizard

By using the User And Group Permissions you can organise your users in to groups and grant them access to only those areas of your database you want them to have, you can also determine weather or not they have have read and write or just read only functionalities. This in conjunction with Password access will do the job.

Note : You do need to ensure you read up carefully on this subject, because one small mistake can be the end, so make sure you have a back up of your database before you commence with the setting up of your security.

FAB

John
 
Your kidding me! If only id known this! Thank you... I will start reading up on it now.
 

Users who are viewing this thread

Back
Top Bottom