Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

Password Tries

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iholder - 03 Mar 2005 21:37 GMT
I could like to add additional code to track number of invalid password
tries attempted by user. After 3 times log-out automatically.

Private Sub PassWordLookUp_LostFocus()

  'test for blank password
  If IsNull([PassWordLookUp]) Then
     MsgBox ("Must Enter Valid Password")
     LookupUserID.SetFocus
        PassWordLookUp.SetFocus
        PassWordLookUp = Null
        Exit Sub
  End If
 
'test for valid password
   Dim strValidPassWord As Integer
      strValidPassWord = DCount("*", "tblOperators", "[PassWord] ='" &
[PassWordLookUp] & "'")
      If strValidPassWord = 0 Then
        MsgBox "Invalid Password Entered"
        LookupUserID.SetFocus
        PassWordLookUp.SetFocus
        PassWordLookUp = Null
       
        Exit Sub
     End If
End Sub
John Spencer (MVP) - 04 Mar 2005 01:59 GMT
Add a static variable and increment it.  When it reaches 3 failures, exit the database

Static intFailure as Integer

If intFailure = 3 then
 DoCmd.Quit
Else
 intFailure = intFailure + 1

 'Your existing code here.

end if

> I could like to add additional code to track number of invalid password
> tries attempted by user. After 3 times log-out automatically.
[quoted text clipped - 23 lines]
>       End If
> End Sub
iholder - 04 Mar 2005 13:31 GMT
Thank You, John

I am not sure of the placement of code.
Where is the variabel declaration placed. And what part of the code is tries
counter placed

> Add a static variable and increment it.  When it reaches 3 failures, exit the database
>
[quoted text clipped - 36 lines]
> >       End If
> > End Sub
John Spencer (MVP) - 05 Mar 2005 03:11 GMT
Probably something like the following.

Private Sub PassWordLookUp_LostFocus()

Static intFailure as Integer

If intFailure = 3 then
 DoCmd.Quit
Else
 intFailure = intFailure + 1
  'test for blank password
  If IsNull([PassWordLookUp]) Then
     MsgBox ("Must Enter Valid Password")
     LookupUserID.SetFocus
        PassWordLookUp.SetFocus
        PassWordLookUp = Null
        Exit Sub
  End If
 
'test for valid password
   Dim strValidPassWord As Integer
      strValidPassWord = DCount("*", "tblOperators", "[PassWord] ='" &
[PassWordLookUp] & "'")
      If strValidPassWord = 0 Then
        MsgBox "Invalid Password Entered"
        LookupUserID.SetFocus
        PassWordLookUp.SetFocus
        PassWordLookUp = Null
       
        Exit Sub
     End If
End If
End Sub

> Thank You, John
>
[quoted text clipped - 42 lines]
> > >       End If
> > > End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.