Results 1 to 12 of 12
  1. #1
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122

    tracking who has been accessing the BE database

    What's the best way to keep track of who has login at any given time? There is a little program call "LDBView" but it does not give me the name of the users, but just the machine name. It is also written for prev. access versions, so, does not work well with Access 2010 and beyond.

    Well, in my Database, I have people using their FE to access the BE data. I can track who has been login by flipping a "Login" switch from No to Yes. However, in the circumstances people's FE crashed, they force themselves out by Ctrl-Alt-Del, the Login switch will remain Yes. The other scenario is user can potentially open up multiple incident of their FEs and mess up the Login switch.

    So, any people have good idea how to do that? Thanks in advance.

    Sincerely,


    Perry

  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    One option is to write your own code to audit who logs in and out.


    After a few minutes of searching I found:
    LDB Viewer Application replacement follow the link in the Answer area.
    LDBViewer2010
    I-need-an-ldb-viewer
    how-to-see-who-is-using-my-access

    good luck......

  3. #3
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Ty so much for your help! See comments below and I have one additional questions:

    LDB Viewer Application replacement follow the link in the Answer area.- this is for Access 2000 or prior only.
    LDBViewer2010 - this is simplest and it works but I am not sure how to interject User Name in there... i.e. not just showing computer name. Also, how does the results show up in a form? I don't want to go to the module everytime to figure out who has login.
    I-need-an-ldb-viewer - the following link that take you to download the viewer is not active.
    how-to-see-who-is-using-my-access - this is closest to what I wanted, but, how do I bring the final form to the FE instead of living in the BE. Is there a way for me to execute the BE form and display the data in the FE?

    These seems silly questions, so sorry, not sure how best to ask. Ty in advance!!

    Sincerely,
    Perry

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If you're going to examine ldb type files then I can only see it working if you have captured their machine name via something like fOsUserName, which is a function that uses API calls. Or you can compare user table machine id values against what's in the lock file. fOsUserName is readily available, but you might need to be concerned about 32 vs 64 bit versions, so I'd use a version that's written for both if I went that way. However, neither of these are much good if a person can move around and use different pc's from one login to another.

    Maybe state what your concerns are and what it is you want in general terms. For example, is this a historical record of log ins only? Log ins and log outs? Either/both but not historical? Active connections only? There's not much you can do about abnormal shutdowns if you're relying on records to indicate active connections.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Micron,
    TY for your time as usual!! I love this forum!

    OK, let me start from the beginning. I have a UserLogin Form already, user needs to enter their name and PW from the local FE in order to access the BE Database on the server for tracking referrals. Currently, everytime an user login, the BE [CurrentlyLogin] field in a table will change to YES. When they quit the database via a quit button (I disabled everything else), the code will change the [CurrentlyLogin] to NO. This works mostly, but in the following 2 situations:
    1. If they open 2 incidents of the FE database, upon Quiting the dabase, the code will change the [CurrentlyLogin] to a NO. (I am not sure how to code it so that it will check if another version is still login)
    2. If the user user Ctrl-Alt-Del to quit the database or it had a hard-crash, then, the database will probably not know they are out. (this part is probably not as critical, and probably not preventable).

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    just my thoughts:
    user needs to enter their name and PW from the local FE in order to access the BE Database
    Why? IMHO, the only case where I would bother with all that stuff about logins and forgotten passwords is when a user might share a pc and anyone could be logged on to that pc. Then logging in to a db is pretty much necessary. Otherwise I'd have tblUsers with fields for all their pertinent attributes (e.g. EmplNo, FName, LName, WindowsID, etc.). If they try to open the db I get their Windows LoginID and look for it in the table. If they're not listed there, they don't get in.

    As for issue #1, I wouldn't allow that in most cases. However if you do, allow login records based on the machine id (refer back to fOsUserName or any other code to get the machine id of the logging in user). That way you can have multiple logins based on machine identity and set to no for each FE that closes by looking up (DLookup) the current machine name. There are 2 other alternatives that come to mind: Environ variables (which I've read can be spoofed) OR you can create your own user object (class module) and assign it any property you want.

    #2 - I can only envision looking back from the BE for active connections, but I've never done it and consider it too much effort for too little gain even if it can be done reliably. I would not bother with ldb files as I've seen them stick around for periods of time even after a proper shut down, but more so after an abnormal shutdown. If you were to not allow entry based on that, you might encounter situations where a legit attempt to log in is denied. If a person's permissions are not properly set for the BE folder (they must be allowed to delete files otherwise the ldb file remains) they wouldn't be able to enter in that situation either.
    Last edited by Micron; 05-07-2019 at 01:21 PM. Reason: spelin and gramur
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Micron, you are absolutely right. I should not spend so much time on this for little gain!! Really. Ty for pointing me to the reality.

    OK, just for my vbCoding lesson purposes, how do I send the debug print results to a Text.Value? Debug.Print Trim(rs.Fields(0)), "|", Trim(rs.Fields(1)), "|", Trim(rs.Fields(2)), "|", Trim(rs.Fields(3)). I tried the following, and it only printed me the last User!?

    While Not rs.EOF
    Me!Text0.Value = Me!Text0.Value & vbCrLf & Trim(rs.Fields(0)) & " " & Trim(rs.Fields(1)) & " " & Trim(rs.Fields(2)) & " " & Trim(rs.Fields(3))
    rs.MoveNext
    Wend

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Its actually not that difficult to track who is logged in at any time and I find it can be extremely useful to do so
    I have several example apps that you are welcome to use/adapt
    1. Logged in users http://www.mendipdatasystems.co.uk/l...ers/4594398123
    2. Password login http://www.mendipdatasystems.co.uk/p...gin/4594469149

    There are 3 methods of getting user name and computer name
    Environ - can be spoofed as already mentioned
    FOSUserName/fOSComputerName - use API so needs adapting for 32/64-bit
    WScript - simple and effective with no issues
    All 3 methods are outlined in these links
    http://www.mendipdatasystems.co.uk/g...ame/4594424315
    http://www.mendipdatasystems.co.uk/g...ame/4594488772
    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

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    To be clear, that statement was about #2 only - trying to handle abnormal shutdowns. You can't run code (even on a hidden form) when someone basically pulls the plug.
    The rest will have to wait - I'm on hold and the tech guy just came back!

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I tried the following, and it only printed me the last User
    That code doesn't appear to have anything to do with the debug line above so I don't get the connection between the two. The first line has no concatenation either? In the second line, why would you want to create in a textbox 2 rows of data for every record in the loop? Is this some kind of huge memo field? The idea seems to go against the norm for displaying records.

  11. #11
    perryc is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2019
    Posts
    122
    Thank you all for helping. I think I am happy with a combinations of your suggestions.

  12. #12
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    I capture who's logged in with an action log - what button they clicked plus additional info such as record ID, filter etc which in turn is used for a) the user to be able to track their history aka web browsers and b) helps with reporting and resolving unexpected errors. I don't use a yes/no flag, I use date/time and the action would be login or logout. Only thing it can't capture is a whole system crash. The log can be cleared or archived as and when necessary. By using dates you can also close users out after a period of time from last entry - the FE polls the action log on a timer - if now is greater than last login time plus say 30 minutes, disconnect from BE and perhaps close app - depends on the circumstances.

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

Similar Threads

  1. Two different users accessing Access database
    By ultimateguy in forum Access
    Replies: 3
    Last Post: 06-25-2014, 03:43 PM
  2. Replies: 5
    Last Post: 05-20-2014, 01:05 PM
  3. Problems accessing a split database
    By tobydobo in forum Access
    Replies: 51
    Last Post: 09-24-2012, 08:49 PM
  4. Accessing Oracle database
    By rbodhale in forum Access
    Replies: 1
    Last Post: 06-23-2011, 08:18 AM
  5. Multiple users accessing same database
    By 4ACE in forum Access
    Replies: 0
    Last Post: 02-28-2008, 03:10 PM

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