Solved

Check for computer startup

Posted on 1998-10-13
2
124 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2016 VB code 9 103
Visual Basic Excel Formatting error 4 83
String manipulation in Visual Basic 7 59
SLMGR Switches Are Not Working On KMS Host 3 69
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

920 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

17 Experts available now in Live!

Get 1:1 Help Now