Solved

Check for computer startup

Posted on 1998-10-13
2
123 Views
Last Modified: 2010-04-30
Is there a way to see if a computer has been started after the first of the month.  I am trying to figure this out to backup data in an Access database.
Thank You
0
Comment
Question by:robhas
2 Comments
 
LVL 6

Accepted Solution

by:
clifABB earned 20 total points
ID: 1439641
About the easiest way is to write the date to the registry (using SaveSettings) every time your app starts.  Then compare the date with Now and run your backup utility if the month is different.

Sub Main()
  Dim dtOld As Date

  dtOld = GetSetting("MyApp", "Startup", "OldDate", Now)
  If Month(dtOld) <> Month(Now) Then
    Call BackupDB
  End If
  SaveSetting "MyApp", "Startup", "OldDate", Now
End Sub
0
 

Author Comment

by:robhas
ID: 1439642
Thank You for your help.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now