Solved

Check for computer startup

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…

776 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