Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Macallan60 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2010
    Posts
    51

    Check CPU Up Time

    Greetings,

    I have a Access 365 32-bit database running on several Win10 machines. This is a split database with the front-end loaded on the user's PC and back-end on a shared server.
    I want my users to restart their PC each morning. Does anyone know of any VBA that will read the CPU Up Time in the Task Manager's Performance tab? When the database is launched, I want it to give the user a message box if the PC has not been restarted in the past 24 hours.



    Thanks in advance.

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    You could have a table in BE that records users' login (and logout), and review the time as appropriate.
    Not exactly using TaskManager, but could accomplish what you need.

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I didn't see where this was about db uptime, just pc uptime, so if it's about pc uptime, a table won't help. I think the big question is why would you tie Access to pc uptime? It makes no sense to me, but if there is a good reason I'm curious as to what that might be. Can you divulge the reason?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Macallan60 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2010
    Posts
    51
    Micron, you are correct. I'm want to examine the PC up time. I have found that regular a restart (aka reboot) of these PCs helps performance. I have instructed my users on how perform a restart of the PC, but I'm having issues with them complying. Some of these PCs run for weeks without a restart. So, when the database is launched, I want to be able to measure the amount of time from the last PC restart and send the user a message if it has been greater than 24 hours.
    I've noticed the Task Manager displays the time from the last PC restart as Up Time, but I'm open to other options.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If I google ms access vba get pc uptime I get 97 hits, some with code. Rather than plagiarize it, I'll suggest you do the same and review the results to see if any of them will work for you. At most, I suppose you could deny access to back end tables. Forcing a reboot in code (if it's even possible) would be reckless.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    Macallan60 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2010
    Posts
    51
    Well I was hoping for a little more help since I'm fairly new to VBA. But, I'll do as you suggested. But, as you said "rather than plagiarize it", I'll make sure not post my solution.

  7. #7
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I would recommend the GetPCPUptime from Daniel Pineault's site.

    I have instructed my users on how perform a restart of the PC, but I'm having issues with them complying.
    This is a management issue, not a computer issue. But. having some statistics may help reinforce the standard operating procedures.

    But then again, why does reboot improve things? Perhaps a compact and repair...

  8. #8
    Macallan60 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2010
    Posts
    51
    Orange, I don't think you are understanding what I'm asking. A PC (aka computer) needs to be rebooted periodically. This improves the performance of the PC.

    I have PCs that our end users haven't rebooted in weeks. What I'm looking for is when the database is launched, have it determine when the last time the PC was rebooted. If it's more than 24 hours, display a message box saying "Reboot your PC". After clicking OK, the database closes. The database will NOT force a reboot. It simply will not open until the PC has been rebooted.

    I have tried the management route with no luck.

  9. #9
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Well I was hoping for a little more help since I'm fairly new to VBA.
    We have no idea about the level of expertise of new forum members. You came across as something more than an outright novice, so if that's not the case it's just a misunderstanding. You are at only 15 posts, which is not enough to gauge your level let alone remember it. If you need more help I think you'll find that there's tons of it here but all you have to do is ask. If you looked at the code and tried but failed to make it work or simply had questions about it, again, just ask. I have worked for days many times to provide solutions to problems, so it's not that I'm lazy. In those many cases I simply had a good understanding of the goal and the OP's level of expertise, and they cooperated. I took your comment about not posting a solution to be a bit snarky and I think others in the background will too. Not a good start, but that's just my opinion.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    What exactly is the underlying problem you are trying to solve?

    According to Daniel: So I set out to write a function to determine the server’s uptime

    Seems you could use Daniel's routine and depending on the value returned by PCUptime you could resolve/identify the issue.

    My laptop: ?getpcuptime
    21 days


    I still see the issue reported in your post as a management issue -- been there and solved that. But if you prefer to "automate" some work around rather than talk/train the users that is an option.

  11. #11
    Macallan60 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2010
    Posts
    51
    You fired the first shot Micron. I took your "google ms access vba get pc uptime I get 97 hits" as pretty snarky. But that's my opinion. Myself, just like many other user, do Google for solutions to our questions. And as a last result, we come to forums like this for help. Only to be told to go Google it. Not helpful at all. There are a lot of good people on these forums that go out of there way to help the less educated on Access such as myself. And I'm grateful for every one of them. But then there are a small few that enjoy belittling.

    As for my issue, I'll just go to each user's PC and manually verify they rebooted.

  12. #12
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Well, you misunderstood my intent. Don't worry, won't happen again.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  13. #13
    Macallan60 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2010
    Posts
    51
    Your intent was very clear Micron.

  14. #14
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  15. #15
    Macallan60 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2010
    Posts
    51
    Orange, the solution is that I will visit to each user's PC and verify that it has been rebooted.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-08-2019, 03:09 AM
  2. Replies: 2
    Last Post: 07-23-2015, 07:12 AM
  3. Form Check Date/Time Format
    By JayRab in forum Forms
    Replies: 7
    Last Post: 02-23-2014, 09:24 PM
  4. Date and time check
    By polis in forum Programming
    Replies: 2
    Last Post: 09-30-2011, 09:26 AM
  5. Check time Diff.
    By wes028 in forum Access
    Replies: 3
    Last Post: 03-08-2010, 10:05 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