How can I programatically check if a users password is correct?
I have a secured ms-access application (ie I have an alternative workgroup file) 开发者_高级运维where different users are allocated different member groups, and I use these to control access to sensitive parts of the application.
I have now found a scenario where my normal user is working on a form and wants to perform a "protected" function (I am thinking about deleting a record - not actually deleting it, but marking it as deleted functionally in the database). What I would like to do is pop up an "approval" dialog box with a username and password field and have this normal user call the supervisor over to enter their username and password. I know how to check whether a given user belongs to a given member group - so could check the username entered by the user is one in the supervisory group, but I don't know how to check if this supervisory user has entered their password correctly.
I assume that passwords are held in a table somewhere in an encrypted form. Is there a vb function to check that password, or perhaps a function to encrypt text retrieved from a text box on a form to compare against the encyrpted password in the database.
The user must have entered the correct password for their account to gain access to the program in the first instance, therefore you will only need to check their group membership to confirm whether or not they can carry out this function, no need for another password check.
精彩评论