I frequently need to compact and repair databases between 7 and 8 am. therefore, i need everybody out of the db. I have put the code below together to force people out, but when I am compacting, this allows the user into the db and would prevent compact from working.
Does anyone know a way to put this type of code into a cmd file that would prevent the db from ever opening when ran? Or is there another way to keep users out until i'm done repairing?
thanks!
Dim CurrentTime
CurrentTime = Time
Dim StartTime
StartTime = #8:00:00 AM#
If CurrentTime < StartTime Then
MsgBox ("too early to use db. Try after 8:00")
Application.Quit acSaveYes
End If
Does anyone know a way to put this type of code into a cmd file that would prevent the db from ever opening when ran? Or is there another way to keep users out until i'm done repairing?
thanks!
Dim CurrentTime
CurrentTime = Time
Dim StartTime
StartTime = #8:00:00 AM#
If CurrentTime < StartTime Then
MsgBox ("too early to use db. Try after 8:00")
Application.Quit acSaveYes
End If