Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Templates > Access Updater > Addendums
Access Updater Addendums

Reboot Top of the Hour

I have my "server" database reboot once per hour. I work from home, so I like to hear the sound (I use a Star Trek transporter sound, which I'm sure many of you have heard in the background of some of my videos. I like it. Too bad.) It comforts me to know that everything is running smoothly and the database is rebooting when it should.

Recently, I decided that I'd like it to reboot at the top of the hour. So my database is now kinda like a cuckoo clock. If you'd like to do the same, just insert the following red lines of code into the CheckForReboot sub:

Private Sub CheckForReboot()

    Dim LastRebootTime As Date
    Dim ExpectedRebootTime As Date
    Dim RebootMinutes As Long

    If Abort Then Exit Sub
        
    If IsNull(LastReboot) Or LastReboot = "" Then LastReboot = #1/1/1990#
    If IsNull(RebootXMin) Or RebootXMin = "" Then RebootXMin = 0
    
    If RebootXMin = 0 Then Exit Sub
    
    LastRebootTime = CDate(LastReboot)
    RebootMinutes = CLng(RebootXMin)

    ExpectedRebootTime = DateAdd("n", RebootMinutes, LastRebootTime)
    
    ' Add this to force your system to reboot at the top of the hour
    ' I recommend only doing this if your reboot interval is a MINIMUM of one hour
    Dim NextHour As Long
    NextHour = Hour(ExpectedRebootTime)
    ExpectedRebootTime = DateSerial(Year(ExpectedRebootTime), Month(ExpectedRebootTime), _
        Day(ExpectedRebootTime)) + TimeSerial(NextHour, 0, 0)

    
    If ExpectedRebootTime < Now() Then
        RebootOnly
    Else
        Status "Reboot at " & ExpectedRebootTime
        SleepSec 2
    End If

End Sub

That's it. Now your system will reboot at the top of the next hour. I'll incorporate this into the AccessUpdater master copy the next time I edit it. For now, you've got to do the grunt work yourself. Suck it up. :) jk

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Access Updater Addendums
Get notifications when this page is updated
 
 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/28/2024 10:03:04 AM. PLT: 0s
PermaLink  Access Updater Addendums