I have a standard FE/BE database. I'd like to be able to have a
button on each db that allows the admin to compact the database. I am
using the following code to perform the compact.
Private Sub bCompact_Click( )
On Error GoTo Err_bCompact_Cl ick
CommandBars("Me nu Bar").Controls( "Tools").Contro ls("Database
utilities").Con trols("Compact and repair
database...").a ccDoDefaultActi on
Exit_bCompact_C lick:
Exit Sub
Err_bCompact_Cl ick:
ErrorMessage Me.Name, "bCompact_Click ", Err.Number,
Err.Description
Resume Exit_bCompact_C lick
End Sub
The bCompact button on the FE is on a password protected Admin Menu.
The BE will only be run by the Admin and only when a compact is
needed. thus the bCompact button in on the MainMenu on the BE.
I would like to add two pieces of code as follows...
1) BE - Add code that determines if anyone has the database open and
only performs the compact if no one does.
2) FE - Add code that determines if a compact is in progress and
closes the db if so. (Opinions as to whether this is actually
necessary are welcome. Even at 2-3 times the maximum expected data
storage, a compact should only take a few secodns to perform and all
users are in the immediate vicinity thus word of 'compacting is about
to start' SHOULD be easy to maintain.)
Thanks
button on each db that allows the admin to compact the database. I am
using the following code to perform the compact.
Private Sub bCompact_Click( )
On Error GoTo Err_bCompact_Cl ick
CommandBars("Me nu Bar").Controls( "Tools").Contro ls("Database
utilities").Con trols("Compact and repair
database...").a ccDoDefaultActi on
Exit_bCompact_C lick:
Exit Sub
Err_bCompact_Cl ick:
ErrorMessage Me.Name, "bCompact_Click ", Err.Number,
Err.Description
Resume Exit_bCompact_C lick
End Sub
The bCompact button on the FE is on a password protected Admin Menu.
The BE will only be run by the Admin and only when a compact is
needed. thus the bCompact button in on the MainMenu on the BE.
I would like to add two pieces of code as follows...
1) BE - Add code that determines if anyone has the database open and
only performs the compact if no one does.
2) FE - Add code that determines if a compact is in progress and
closes the db if so. (Opinions as to whether this is actually
necessary are welcome. Even at 2-3 times the maximum expected data
storage, a compact should only take a few secodns to perform and all
users are in the immediate vicinity thus word of 'compacting is about
to start' SHOULD be easy to maintain.)
Thanks
Comment