Validate workgroup password

  • Thread starter Thread starter Connie B via AccessMonster.com
  • Start date Start date
C

Connie B via AccessMonster.com

I have a pair of databases secured with a workgroup file and I have created a
custom password change form, which is working fine. What I would like to add
is a way to validate that the user has changed his first-time temporary
password to a 'real' password before letting him proceed to use the
application. (I thought that I might put this in the on open event of my main
menu which is called on startup.)

I know that the workgroup file encrypts the passwords, but is there a way to
pass the temp password ('temppw') to the workgroup file and compare that
string to the currentuser's password? I don't need the password returned,
just a true/false value, so that I know whether to force the user to change
the pw or if it has already been done.

If this is impossible, any alternate suggestions would be greatly appreciated.


Thanks in advance!
 
I would, instead, make the initial password null/blank/nothing. Then you
can test to see if they have yet set a real password, and present a form for
them to do so.

You would try to open a DAO workspace in code using CurrentUser() for the
user name, and a blank password for the password argument.

If the password is not blank, you'll trap the error and know that the user
has a password. If you don't get an error, you'll know that the password is
still blank.
 
Thank you for the idea, but it still doesn't get over my initial problem. I
can easily test currenuser or group by using:

wsp.Users(i).Name = something or wsp.Users(i).Groups = something else
(where wsp and i represent workspace and index)

but wsp.Users(i).Password does not return anything I can test against.
Specifically:

If IsNull(DBEngine.Workspaces(0).Users(CurrentUser).Password) = True Then
blah blah blah

gives a compile error: Invalid use of property, which is the same error that
I receive if I try to test to see if it equals a specific value.

Is there another syntax that I can use to test either for a specific value or
for a null value for the password?

I have created a work-around for the problem, but the mystery is still
bothering me.
 
You misunderstand what I suggested. You can't retrieve the password
directly, so you test to see if it is blank. For example, try to open a new
workspace, passing CurrentUser() as the username and "" as the password. If
you get an error, you know that the "" password isn't correct, and they have
a non-blank password.
If you don't get an error, then the "" password is correct, and they have a
blank password.

Dim ws as Workspace
Set ws = DBEngine.CreateWorkspace("tempws", CurrentUser(),"")
If Err=0 then
'they have a blank password
'what do you want to do
'open a change password form
'throw up a message
Else
'they don't have a blank password
'do nothing
End If
 
Yes, I did misunderstand but now I get it. I knew that I could not retrieve
the password, but I thought maybe there was a way to pass a value to compare
without retrieving it and just get a true/false answer back. I like your idea
since it is the error message that I am testing for, instead of a true/false
to see if the password equals my variable (or null value).

Thanks for your help!!!!!
 
Back
Top