How to count the login attempts?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jesse Jones
    New Member
    • Jan 2011
    • 51

    How to count the login attempts?

    I have a login form in my access database that is working perfectly. I would like to count how many times the command button is clicked so I can do things such as close the program aftr so many failed attempts, etc.

    Can anyone tell me how to make this happen? How do I count the number of times a button us clicked?

    Thank you.
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    There are several ways to count it. You can count it in a hidden field on the form, you can count it as a form level variable, or you can count/store it in a table.

    Simply closing the program after X attempts is not in itself enough, since the user can just reopen the program. So if you want to prevent him from trying more then X times per day, you could store the amount of attempts he has tried, each day (You can record the username used to login to the computer, and the day).

    However, in my honest opinion you should consider if this is really necessary, and if you really believe it is, you should consider whether access as a database is secure enough for you.

    That said, if you wish to proceed with recording user attempts, I would be happy to guide you through the coding process.

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      This would be the general idea, with the Code being placed in the Click() Event of a Command button:
      Code:
      Static intNumOfButClks As Integer
      
      intNumOfButClks = intNumOfButClks + 1
      
      MsgBox "This Button has been clicked " & intNumOfButClks & " time(s)"
      
      If intNumOfButClks = 10 Then intNumOfButClks = 0        'MAXIMUM number of Clicks, RESET

      Comment

      • Jesse Jones
        New Member
        • Jan 2011
        • 51

        #4
        Thanks, Smiley, here's where I'm at. I don't need this database to be super secure at this point. I'm mostly trying to protect it from lazy or curious users. I'm not worried too much about malicious attacks. It's internal only.

        I would like to be notified eventually when someone tried to log into the database more than five times. The first step in this is being able to count the attempts. Eventually, I'd like it to email mecif possible. But anyway, I was thinking it had to be dimple with a hidden field on the form. If you could help me with this, I'd appreciate it a lot.

        Thanks.

        Comment

        Working...