How to Add Simple User-Level Security to Microsoft Access Databases

Поділитися
Вставка
  • Опубліковано 5 жов 2024
  • In this Microsoft Access tutorial I will teach you how to add simple user-level security to your databases. We will create a user table and give each user a logon name and password.
    Disclaimer: This tutorial will show you security that is "good enough" to keep most users out of your database. However an experienced Access developer will be able to bypass this logon routine. To learn the best possible way to secure your database I recommend my Microsoft Access Security Seminar. 599cd.com/Secu...
    BECOME A MEMBER:
    UA-cam: / @599cd
    or My Site: 599cd.com/THMe...
    LEARN MORE:
    599cd.com/User...
    PREREQUISITES:
    Intro to VBA: 599cd.com/Intr...
    Modal & Popup: 599cd.com/Moda...
    DLookup: 599cd.com/DLookup
    NZ Function: 599cd.com/NZ
    If Then: 599cd.com/IfThen
    MsgBox: 599cd.com/MsgBox
    Simple Security: 599cd.com/Simp...
    LINKS:
    Input Mask: 599cd.com/Inpu...
    Double Double Quotes: 599cd.com/Doub...
    Track Log On: 599cd.com/Trac...
    Database Password: 599cd.com/Data...
    RECOMMENDED COURSES:
    Access Security Seminar: 599cd.com/Secu...
    Access SQL Server Online: 599cd.com/SQLO...
    NEXT VIDEO:
    User Level Security Part 2: 599cd.com/User...
    FREE TEMPLATE DOWNLOADS:
    TechHelp Free Templates: 599cd.com/THFree
    Blank Template: 599cd.com/Blank
    Contact Management: 599cd.com/Cont...
    Order Entry & Invoicing: 599cd.com/Invo...
    More Access Templates: 599cd.com/Acce...
    ADDITIONAL RESOURCES:
    FREE Access Beginner Level 1: 599cd.com/Free1
    How to Use Access in 30 Minutes: 599cd.com/30Mi...
    $1 Access Level 2: 599cd.com/1Dollar
    Donate to my Tip Jar: 599cd.com/TipJar
    Get on my Mailing List: 599cd.com/YTML
    Contact Me: 599cd.com/Contact
    TechHelp: 599cd.com/Tech...
    Consulting Help: 599cd.com/DevNet
    Twitter: / learningaccess
    en.wikipedia.o...
    products.offic...
    microsoft.com/...
    KEYWORDS:
    access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, How do I set up security, What happened to user-level security, securing a Microsoft Access database, How To Manage User Permissions In Access Database, user table, usert, username, password
    QUESTIONS:
    Please feel free to post your questions or comments below. Thanks.

КОМЕНТАРІ • 57

  • @shahramahmadzadeh5285
    @shahramahmadzadeh5285 Рік тому +5

    Hello Mr. Rost. I just wanted to say a big thank you to you for presenting this topic.
    I have been waiting for this presentation for a long time.
    I consider you my teacher, because I have learned a lot from you.
    Unfortunately, I live in Iran and because of the embargo, I cannot buy your courses.
    Once again, thank you for all your kindness and cares.

    • @599CD
      @599CD  Рік тому +1

      You're very welcome

  • @thomascole8216
    @thomascole8216 Рік тому +2

    Pure Gold! Great Instructor, easy to follow. Everytime I watch I learn another nugget I didnt know. Thank You

    • @599CD
      @599CD  Рік тому

      Glad to help

  • @rhodnill5906
    @rhodnill5906 Рік тому

    I did this thing to my project, but to make it more secure, I hashed(encrypt) the password and the Username so that "if" someone can bypass my database and get accessed to the UserT, the password and Username field is hashed or encrypt. I did the Hash password twice, there's a Level 1 Hash then Level 2 Hash.
    Its like Password ⏩ Level 1 Hash ⏩ and the Level 1 Hash, Hash it again to Level 2 Hash and store it to the Password field in the UserT. just to make it secure. I also hashed the Username so that the bypasser have no Idea what is going on. 🤣🤣 But, thank you, my VBA code is more like a ancient text to read, so difficult to understand and it has more than 20 lines of code, unlike to your VBA Code is straightforward and easy to understand. 🤗😍 Can't wait for the Part 2 and 3. 🔥🥰

    • @599CD
      @599CD  Рік тому

      Yeah, I do something similar with sensitive data: 599cd.com/Encrypt

  • @onpassive2441
    @onpassive2441 10 місяців тому

    You are a great trainer. I enjoy your lessons. I wish my English was better so I could join the group

    • @599CD
      @599CD  10 місяців тому

      Thank you! 😃

  • @Dragon-vv2ew
    @Dragon-vv2ew Рік тому

    Hi Richard, your videos are always interesting, every time I see your videos I always learn some little properties to add to my little databases. Thanks again to you and your team! I'm sorry I don't know English but with subtitles you can understand perfectly.Many greetings from Italy!
    Ciao Richard, sempre interessanti i tuoi video, ogni volta che vedo i tuoi video imparo sempre qualche piccola proprietà da aggiungere ai miei database. Grazie ancora a te al tuo team! Mi dispiace non sapere l'inglese ma con i sottotitoli si riesce a capire perfettamente. Tanti saluti dall'Italia

    • @599CD
      @599CD  Рік тому

      You're very welcome

  • @meowmadecrafts
    @meowmadecrafts Рік тому

    I was literally about to implement something similar today! Thank you for sharing!

  • @RichardNickyBrian
    @RichardNickyBrian Рік тому

    Thanks for this one too..
    God bless your efforts.
    Mr. Richard, live long and prosper. ❤🎉

  • @Airfo2248
    @Airfo2248 5 місяців тому +1

    Love it! Just what I needed!!

    • @599CD
      @599CD  4 місяці тому

      Glad I could help!

  • @muraterkan8521
    @muraterkan8521 Рік тому

    thank Richard. it very very useful and clean instructions.. as always

    • @599CD
      @599CD  Рік тому

      You're welcome

  • @dolittlediehard1670
    @dolittlediehard1670 Рік тому +2

    Very good, love it but it would be better if users could set their own passwords and if the admin got an alert for 3 failed attempts.

    • @599CD
      @599CD  Рік тому +1

      Sure... feel free to add all that if you want

  • @ADITYA_SINGH1
    @ADITYA_SINGH1 Рік тому

    thanks for considering the request sir cant wait for part 3😃

    • @599CD
      @599CD  Рік тому

      You got it

  • @danielantoyma4152
    @danielantoyma4152 6 місяців тому

    Hi Richard, thanks for your videos. I'm trying to find some info about SSO with Access. Would you know if it's possible? Thanks

  • @abaurre3
    @abaurre3 9 місяців тому

    I would like to implement this so I can do two things:
    1- Open diferent forms or dashboards according to different users;
    2- Use this user ID globally to register table changes and operations, by user.
    Is it possible to carry on this "UserID" throughout other functions and subs, including private subs?

    • @599CD
      @599CD  9 місяців тому

      Absolutely it is. 599cd.com/SecuritySeminar

  • @hosseinpeyvandi3992
    @hosseinpeyvandi3992 8 місяців тому

    Nice and clean as always but how can i find part2??

    • @599CD
      @599CD  7 місяців тому

      Links in the description under the video

  • @andinascrocroandinas9352
    @andinascrocroandinas9352 7 місяців тому

    Hi Mr. Rost. One question.
    the code correct is that:
    If IsNull(TempVars("Username")) Then TempVars("Username") = "Nobody"
    MainMenuLbl.Caption = TempVars("Username")
    but if I have the second label that I want use in the same form, I just copy code? like that:
    example
    If IsNull(TempVars("Job")) Then TempVars("Job") = "Nobody"
    JobLbl.Caption = TempVars("Job")
    thanks

  • @UltraStarWarsFanatic
    @UltraStarWarsFanatic Рік тому

    Richard, can you tie these accounts to the ability to enter design view/etc.? In the sense of having an account for developers, and another account for end users?

  • @TopGearEthiopia
    @TopGearEthiopia 7 днів тому

    Hi Mr. Rost. Thanks for the training however, Please leave the password blank and see the result!

  • @thunderkai430
    @thunderkai430 Рік тому

    Hello Mr Rost. Thank you so much for the tutorial. I want to ask that how do I add a "Hello" before the TempVars("Username")? Like I want to show "Hello XXX" in the main menu caption. Thank you.

    • @austinmyers106
      @austinmyers106 Рік тому +1

      you could do something like this
      MainMenuLabel.Caption = "Hello" & " " & TempVars("Username")
      still learning access, but i think that would work

  • @jtjones1294
    @jtjones1294 Рік тому +3

    There's an issue if you have a correct user but blank password it will let you logon. I fixed the code by adding an or IsNull(Password) to the password if statement 13:35

    • @599CD
      @599CD  Рік тому

      Yeah - lots of people have brought this to my attention. I'll be mentioning it in Part 4.

    • @johnpescatore7529
      @johnpescatore7529 4 місяці тому +1

      Thanks for the correction ... it was driving me crazy !

  • @rbe6963
    @rbe6963 6 місяців тому

    Would it be a waste to pull, with an open recordset in vba, the record for the user and check for the id and password?

  • @MichaelEaton-sd5wk
    @MichaelEaton-sd5wk 9 місяців тому +1

    Hi, how do we handle the password field being blank, It seems that the user can login with no password and I don't want that

    • @599CD
      @599CD  9 місяців тому +1

      Yeah, that's something I really didn't think about when I was recording the video. I just assumed that everyone would know that you need to check for a blank password. Just throw an IsNull in there somewhere. 599cd.com/IsNull. Remember, these videos are more about giving you ideas and showing you what's possible. These are not meant to be finished, complete solutions. If you want a much more detailed and comprehensive security system for your database, check out my security seminar at 599cd.com/SecuritySeminar

  • @luisdacunhalima734
    @luisdacunhalima734 Рік тому

    Hi. Great tips. Just one thing is not clear for me: My password is not Case Sensitive. Could we do that?
    Thanks

    • @599CD
      @599CD  Рік тому +1

      Lots of people have brought this to my attention. I'll be mentioning it in Part 4.

  • @vic902
    @vic902 6 місяців тому

    Can multiple users still access the database if they all have the same login username and password?

  • @petewarby7158
    @petewarby7158 Рік тому

    AWESOME!!!!!!!

  • @jamesrakestraw7125
    @jamesrakestraw7125 Рік тому

    Hello. You make the Login. Do you need to make a Login log to?

    • @599CD
      @599CD  Рік тому

      Sure

    • @599CD
      @599CD  Рік тому

      599cd.com/TrackLogon

  • @Pyar_Sab_K_Lyea
    @Pyar_Sab_K_Lyea Рік тому

    I have 2 fields in UserT table (1 is username) and (2 is Person Name) and I want to show Person Name in Main Menu Label using tempvar("PName") but error occured Invalid Qualifier. HOw to resolve it

  • @willmiranda9710
    @willmiranda9710 9 місяців тому

    Is there a way to create a message box that pops up when your mouse hovers of any label providing the details of the information require for that field.

    • @599CD
      @599CD  8 місяців тому

      599cd.com/ControlTipText

  • @onpassive2441
    @onpassive2441 10 місяців тому

    If possible, activate translation so that we can benefit from your channel more.

    • @599CD
      @599CD  10 місяців тому

      That's a UA-cam feature in the settings you can set whatever language you like

  • @AmayPlays
    @AmayPlays Рік тому

    Hi when I put no password it is letting me in only with valid username

  • @kunashemupfeka939
    @kunashemupfeka939 8 місяців тому

    After inputting all the code into the build even it keeps on saying user not found

    • @599CD
      @599CD  7 місяців тому

      Well that sucks

  • @professional7330
    @professional7330 Рік тому

  • @Rabih.khalil
    @Rabih.khalil 24 дні тому

    Thank you Richard.
    The code is not working properly because the user can logon without password I did'nt know why but i resolved the issue bye changing the code to:
    Private Sub LogonBtn_Click()
    Dim ID As Long, Pw As String

    ID = Nz(DLookup("UserID", "UserT", "Username=""" & Username & """"), 0)
    If ID = 0 Then
    MsgBox "User not found"
    Quit
    End If

    Pw = Nz(DLookup("Password", "UserT", "UserID=" & ID), "")
    If Pw = Password Then
    TempVars("Username") = Username.Value
    DoCmd.OpenForm "MainMenuF"
    DoCmd.Close acForm, Me.Name, acSaveYes
    Else
    MsgBox "Incorect password"
    Quit

    End If




    End Sub

    • @599CD
      @599CD  24 дні тому

      Thanks for sharing