Whos On Log

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tbeers
    New Member
    • Nov 2007
    • 63

    Whos On Log

    Good Morning

    I am using Access 2007 and all users are on the runtime version on a network, with FE and BE. Everybody on XP Pro

    I would like to know what users are on the program at any given time. I have created a tblUserOn and the user is added to the table when he logs on ..no problem. The user triggers a delete query when he exits the program to remove his name from the table. I would like to add one more field and that is a time/date stamp for when the user logged on.

    What's the most efficent method to do that.

    Thanks

    -Tomb
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    Just include the Date/Time value in with whatever code you use to add the user when they log on Tom.

    No idea what you're using for that yet, but whatever it is, add in some similar code to pass the Date/Time too.

    Comment

    • ChipR
      Recognized Expert Top Contributor
      • Jul 2008
      • 1289

      #3
      Here's what I use. startTime is a global Date variable.

      Code:
      170    Workstation = GetMachineName()
      180    startTime = Now
      190    strSQL = "INSERT INTO UsageLog (StartTime, UserName, Workstation) VALUES (#" _
           & startTime & "#, """ & userName & """, """ & Workstation & """);"
      220    DoCmd.RunSQL strSQL, 0
      and later
      Code:
          strSQL = "UPDATE UsageLog SET EndTime = #" & Now & "# WHERE StartTime = #" & startTime & "#;"
          DoCmd.RunSQL strSQL, 0
      The Now Function gives you the date and time, but you can get whatever part you want out of it.

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by tbeers
        Good Morning

        I am using Access 2007 and all users are on the runtime version on a network, with FE and BE. Everybody on XP Pro

        I would like to know what users are on the program at any given time. I have created a tblUserOn and the user is added to the table when he logs on ..no problem. The user triggers a delete query when he exits the program to remove his name from the table. I would like to add one more field and that is a time/date stamp for when the user logged on.

        What's the most efficent method to do that.

        Thanks

        -Tomb
        If you would like a visual indication (via a List Box) of all Users who are Logged-On to your Database at any given time, you can use a very handy multi-user feature of Jet. I can construct a simple demo for you if you are interested.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #5
          ADezii's code is very clever and useful, but it does depend on your users logging on to the database as themselves (into System.Mdw).

          Unfortunately for this method, there are many offices (and homes of course) set up simply to use Admin in all cases, and handle users, where necessary, entirely independently of this.

          You may choose to set up System.Mdw now in order to use this (saving you the development), but without any users set up there you will need to handle it differently.

          Comment

          • ChipR
            Recognized Expert Top Contributor
            • Jul 2008
            • 1289

            #6
            I actually do the same thing to track connected users, but I have a table of employees that includes a field for the workstation name. In a list box, I display the workstation name and the employee's name, which I look up in a combo box hidden on the form.

            Comment

            • ADezii
              Recognized Expert Expert
              • Apr 2006
              • 8834

              #7
              Originally posted by tbeers
              Good Morning

              I am using Access 2007 and all users are on the runtime version on a network, with FE and BE. Everybody on XP Pro

              I would like to know what users are on the program at any given time. I have created a tblUserOn and the user is added to the table when he logs on ..no problem. The user triggers a delete query when he exits the program to remove his name from the table. I would like to add one more field and that is a time/date stamp for when the user logged on.

              What's the most efficent method to do that.

              Thanks

              -Tomb
              and all users are on the runtime version on a network, with FE and BE. Everybody on XP Pro
              NeoPa made an excellent point in Post #5. I simply made the assumption, probably incorrectly, that you had a Security System set in place with access to the BE via User Log-Ons. Can you kindly clarify this for us all?

              P.S. - ChipR also bring up an excellent point in Post #6.

              Comment

              • tbeers
                New Member
                • Nov 2007
                • 63

                #8
                Thanks for all your help. I now have a log-in table complete with date/time stamp. I also have a delete query based on the login form to delete the user from the login table when they leave the program. Works wonderful until I convert to runtime. For some reason, the delete query doesn't work. The BE is on a separate drive (F:\) and the FE is on the C:\ Do I lose some functionality when running 2007 runtime?

                The user login is only on the FE with the user getting the apprpriate menu according to their security limit.


                Thanks

                Tomb

                Comment

                Working...