Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Checking for password in Access 97?

2 views
Skip to first unread message

Bo Christensen

unread,
Jan 1, 1998, 3:00:00 AM1/1/98
to

I am at the present time working at converting a DB from A95 to A97 and have
run in to a problem. I want to check if the users of the DB have defined a
password, and if they have not - force them to do so. In A95 I could check
this by using the NewPassword method with an empty string as old- and new
password, if this gave me an error number 3033, the user had defined a
password. This for some reason doe's not work in A97. If there is anyone who
can give me an solution for this problem, I would be truly grateful.


Roland Ortloff

unread,
Jan 2, 1998, 3:00:00 AM1/2/98
to

Hi,

I have an extra field where the enter once again the password.
You might be able to change the code for your purpose.


' Check if password is correct:
' =============================

Const NOT_VALID_ACCOUNT_OR_PASSWORD = 3029

Dim wspUser As Workspace
Dim iFehler As Integer


' Check for correct password
On Error Resume Next
' Check, if old password is correct
Set wspUser = DBEngine.CreateWorkspace("wspPWD", Nz(Me![txt_USER]), Nz(Me![txt_Password]))

' This should work for you:
' Set wspUser = DBEngine.CreateWorkspace("wspPWD", CurrentUser(), "")

iFehler = Err.Number
wspUser.Close
On Error GoTo 0
If (iFehler = NOT_VALID_ACCOUNT_OR_PASSWORD) Then
KeyCode = 0
Me![txt_Password].SetFocus
MsgBox "Name or password is incorrect."
Exit Sub
End If

Please email to: roland.or...@THISstudbox.uni-stuttgart.de
================ (Please delete the DROP THIS) /;^;\
http://tick.informatik.uni-stuttgart.de/~ortlofrd/ ( o o )
-----------------------------------------------------oOOO--(_)--OOOo----


0 new messages