Solved

Check for computer startup

Posted on 1998-10-13
2
127 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 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