Results 1 to 9 of 9
  1. #1
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038

    Determine which user(s) is logged into backend (BE)

    Hello Experts:

    I recently split a database into "backend" (BE) and "frontend" (FE) where the BE remains on the LAN and users have a local copy of the FE on the C-drive. The process works well.



    At this time, I'd like to expand the FE to include a mechanism so that I (or administrator) can see which user(s) is/are currently logged into the BE. I've come across a ready-to-go solution which contains a single form. The example file "LoggedIn" (attached) did **not** include any special configuration or setup.... GREAT!

    The database's single form includes four fields: Computer; Username; Connected?; Suspect?

    When trying it at work (on LAN) and I opened up the database and the form displayed the following information, for example:
    Desktop12345; Admin; True; (Blank)

    Now, the computer name (some alpha-numeric number) in conjunction with "Admin" does **not** tell me anything about the user's name. So, I was wondering if you please could assist me in tweaking the form.

    Break/break

    In order to tweak the database, allow me to quickly jump into the method of existing database. For instance, my actual database includes a module "M02_UserName" (see "Module.accdb"). That is, the module uses the function fOSUserName() to determine the user's network name. So, any user logged into the LAN automatically is being picked up and shows, e.g., as "John Smith" or "Sally Jones". Having the user's name is much more helpful that the user's computer name.

    That said, I'd like to use fOSUserName() function from the 2nd Access file and somehow integrate it into the "LoggedIn" example database so that I could show the following:
    Desktop12345; John Smith; True; (Blank)
    Desktop98765; Sally Jones; True; (Blank)

    Is that possible? If so, how can achieve it? I appreciate any specific example which would facilitate the integration of the module into the form.

    Thank you,
    EEH
    Attached Files Attached Files

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    The code in your ready made example is getting the same info as in the lock file of which ADMIN is 'set in stone'.
    Its the same approach as in this example of mine http://www.mendipdatasystems.co.uk/l...ers/4594398123
    AFAIK it cannot be modified to get the user name instead of Admin.
    You need a different approach.

    Have a look at another example of mine which stores both user name and workstation.
    http://www.mendipdatasystems.co.uk/p...gin/4594469149
    It requires users to login to the app with username and password.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    isladogs - thank you... appreciate the sample database.

    Yes, I also have a login screen for the database. When I changed the scrambled password in yours to a generic password (testing only), the login form didn't validate successfully. Is there another place where I should change the PWD?

    That said, which forms tracks/shows which user is currently logged into the database?

    Thanks,
    Tom

  4. #4
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    isladogs - your "Check Database Users" form looks much cleaner. WRT the 2nd database, I changed the scrambled PWD to another password (not scrambled) but the login form wouldn't validate the new passwords. Not sure what I'm missing.

    Again, I also use a login form on my database. Quick follow-up question... given the number of users is somewhat limited in size, it's feasible that I could ask all users for the "computer names". If so, I could imagine adding the computer names into the table where I store their login credentials. If so, is there a way I could use a Dlookup to cross-reference to login name to the computer name? How could I then modify your "Check Database Users" form to display the cross-referenced computer name and display their login name on the form?

    Thanks,
    Tom

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    You are free to modify either of the apps yourself, but a few warnings.

    The password form is deliberately designed to work with encrypted passwords. This is for security.
    The best solution is to use active directory settings so as not to store user names/passwords at all.
    However if you must store passwords, encryption is essential.

    In this app, each password is automatically encrypted when it is added or edited using the correct form.
    If you use a non encrypted password, it won't work....and it wouldn't be secure.

    Users can login from any workstation so doing what you suggest wouldn't be reliable. It would also mean you are storing data that shouldn't be stored.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    I have a db that does not require user to enter a username/password. Code simply grabs their network username and matches to a record in Users table then stores workstation ID in that record. A menu form is opened and never closed until user exits db. Then code removes workstation ID from Users record. I don't care about history of usage.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    June7 -- thanks for chiming in... 'appreciate it. Would you mind posting that sample database? Thank you!

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    You already have the database and code via your other thread https://www.accessforums.net/showthread.php?t=78975. Post #3 has the code. A 'login' form is involved but user only sees it on first time utilizing database. Code will create a new record in Users table then they never see login form again. I do this because we need user initials which are later saved to data records. Could modify to eliminate that aspect.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    June - thank you... I'll check it out again.

    Cheers,
    Tom

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-13-2023, 12:45 PM
  2. Replies: 4
    Last Post: 10-29-2016, 12:20 AM
  3. Logged In user Names
    By Parminder in forum Access
    Replies: 5
    Last Post: 07-23-2015, 02:17 PM
  4. Getusername of currently logged in user
    By nkuebelbeck in forum Access
    Replies: 8
    Last Post: 06-29-2011, 04:06 PM
  5. Currently logged in user into text box
    By ne16428 in forum Security
    Replies: 5
    Last Post: 06-10-2009, 11:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums