How to Get the Windows Username in MS Access

Поделиться
HTML-код
  • Опубликовано: 6 мар 2023
  • In this episode, we're going to learn how to get the Windows username for our Microsoft Access application, so that users can be greeted and also to allow us to log certain user actions in our database for administrative purposes. This is a very handy skill for any MS Access developers to learn as it can improve your user's experience and help your logging processes. We'll take a look at two different ways to get the Windows username with the attached domain, so that you can choose which is better for your application.
    Related Videos:
    How to disable and enable the Bypass Key on your MS Access app so users cannot bypass Autoexec/Forms
    • How to disable and ena...
    Link and Relink Your Access Front-End App Using vbScript and a Table-Based Approach
    • Link and Relink Your A...
    How to Use vbScript to Relink Your User's MS Access Application Front-End Automatically
    • How to Use vbScript to...
    Use vbScript to Deploy your Access Front End, Create Shortcuts, and Check for Updates on User Login
    • Use vbScript to Deploy...
    How to Encrypt and Hash Passwords in MS Access
    • How to Encrypt and Has...
    How to Encrypt Sensitive Data in Microsoft Access
    • How to Encrypt Sensiti...
    How to Kick Users out of Your MS Access Database
    • How to Kick Users out ...
    How to Get the IP Address in Microsoft Access
    • How to Get the IP Addr...
    How to Get the Windows Username in MS Access
    You are watching this video now!
    How to Set Basic Startup Options on Your Microsoft Access Database
    • How to Set Basic Start...
    Join me on Patreon!
    / mackenziedataengineering
    Demo of my BZ RDP Cloaker:
    www.patreon.com/posts/how-to-...
    Check out some tech (and support my channel!):
    www.amazon.ca/shop/seanmacken...
    Want the code from this video?
    mackenziemackenzie.com/downloads
    For developers looking for a new role, check out and sign up:
    www.toptal.com/qKaO2b/worlds-...
    Needing to hire technical resources for your project? Get the best:
    www.toptal.com/qKaO2b/worlds-...
    Contact form you can find at www.mackenziemackenzie.com/
    Follow me on social media:
    / mackenziedataanalytics
    / seamacke
    / seamacke
    / seamacke
    / psmackenzie
    Get Microsoft Office including Access:
    click.linksynergy.com/fs-bin/...
    Got a RUclips Channel? I use TubeBuddy, it is awesome. Give it a try:
    www.tubebuddy.com/seanmackenz...
    #msaccess #vba

Комментарии • 25

  • @jupiter2479
    @jupiter2479 10 месяцев назад +1

    You’re a life saver
    Thank you

  • @hassanrozh6579
    @hassanrozh6579 Год назад +1

    Thanks so much, great video.

  • @siclucealucks
    @siclucealucks Год назад +1

    Great excactly I was waiting for

  • @jerzykepinski
    @jerzykepinski Год назад +1

    Thanks, this was good!

  • @RugbyNo17
    @RugbyNo17 Год назад +2

    This is fantastically useful stuff (like all of your videos). I'd like to request a video on how to obtain a user's email address from the GAL in Outlook if you would. Keep on doing what you do, it's EXTREMELY helpful to a rookie Access developer like me. 😎

  • @interestingamerican3100
    @interestingamerican3100 Год назад +2

    Thank you!!! I was wanting to learn this.

  • @gerfer6261
    @gerfer6261 Год назад +1

    1-Handy hint. I have being using second option = environ variable with computer name
    2-Any trick to get the Full name than the login name!!!! Or user email address
    3-User logger also very handy I get login time and log off time
    4- Could not find it in the Download page appreciate if you add it so that I could get it into my collection
    As always appreciate your knowledge base contribution
    Cheers 🏃🏽

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Год назад

      Thanks for the feedback! The downloads page has been updated. Getting more information about the user is possible through a LDAP query if you're in a domain, but that is another function that we will have to explore in another video. I'll add it to my list. cheers

  • @shafiqueahmad9024
    @shafiqueahmad9024 Год назад

    wow. cool solution.
    Sir please make a video on COM control in access. how get data into a table from COM PORT.

  • @mostafamahmoud6803
    @mostafamahmoud6803 11 месяцев назад +1

    thanks for the video , it was really great , can you please show how to get the ip address for the device of the user ?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  11 месяцев назад

      You can use a function like this to get the IP:
      Function IpAddress()
      Dim objNics, objNic, strIP, strComputer, strIps
      Set objNics = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")
      For Each objNic in objNics
      if objNic.IPEnabled then
      strIP = objNic.IPAddress(0)
      If Len(strIps) > 0 Then strIps = strIps & ","
      strIps = strIps & strIP
      End if
      Next
      IpAddress = strIps
      End Function
      To use it, load your variable:
      strIp = IpAddress()
      MsgBox strIP
      or do what you want with it!

  • @abedalil8739
    @abedalil8739 11 месяцев назад +1

    Can you get Windows Password like Username ?!!🙂

  • @alessiosonis981
    @alessiosonis981 5 месяцев назад +1

    I can imagine that this "function" could be used when closing the mask! @seanmackenziedataengineering

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  4 месяца назад +1

      Thanks for sharing!

    • @alessiosonis981
      @alessiosonis981 4 месяца назад +2

      @@seanmackenziedataengineering I took this tutorial and the one "How to Kick Users out of Your MS Access Database" because I would like to create a log file of accesses and exits from the database. Obviously I divided the DB into FE and BE. Am I on the right track? ps: i follow you from Italy!

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  4 месяца назад +1

      @@alessiosonis981 You bet! You can use this one ruclips.net/video/Rqhlr6NwUu8/видео.html to log the time a form is closed.