I've spent the last two days searching for answer to this one and all I've really found is enough ideas to come up with the code below.
My environment is a split database with a few different front ends connecting to the same back end. Only one of the front ends will be used for data manipulation. All others will be report based (pulling useful information from the existing data).
All of the report based front ends will be used by day staff with typical office hours. The data entry front end will typically be single user and in use 24/7.
With that, I feel fairly confident that overnight is the best time to perform back end maintenance since only one user is affected and I can give them some control over exactly when the back end maintenance occurs.
To that end I've come up with the following outline:
Obviously, I still need to write the code to do each of the ***ALL CAPS*** lines. The above was typed out using Notepad just to capture my thought process.
My question to you is about my logic; Is it sound? Does this seem like it would work? Is there a better way to do it?
Thank for taking a look!
My environment is a split database with a few different front ends connecting to the same back end. Only one of the front ends will be used for data manipulation. All others will be report based (pulling useful information from the existing data).
All of the report based front ends will be used by day staff with typical office hours. The data entry front end will typically be single user and in use 24/7.
With that, I feel fairly confident that overnight is the best time to perform back end maintenance since only one user is affected and I can give them some control over exactly when the back end maintenance occurs.
To that end I've come up with the following outline:
Code:
Dim Response
Response = msgbox("Run scheduled maintenance?" & vbcrlf & vbcrlf & _
"Selecting yes will momentarily disable the database." & vbcrlf & _
"Select no if you have any unsaved work.", vbyesno, "Scheduled Maintenance Required")
If Format(TimeValue(Now()), "hh:mm") = #01:00# then
If Response = vbyes then
***KICK OTHER USERS OUT***
***CLOSE FRMHOME***
***DISCONNECT FROM BACKEND***
***BACKUP BACKEND***
***REPAIR AND COMPACT BACKEND***
***CONNECT TO BACKEND***
***OPEN FRMHOME***
else: ***WAIT 5 MINUTES AND ASK AGAIN***
end if
End if
My question to you is about my logic; Is it sound? Does this seem like it would work? Is there a better way to do it?
Thank for taking a look!