Backup Database Button

T

Trial & Error

The database I am working on will eventually have several security levels.
One level will allow the user to access tables & make complete alterations
to the system etc... they would also have access to the toolbars in order to
back up the database...

Is there any way to program a button to run the database backup??

I do not want ALL of my staff to have access to the design level of the DB..
but I DO want any of my staff be able to backup the DB.

I know that the toolbox "create button" command has many options... but
running a backup is not one of them.

I imagine this is quite possible... just interested in how its done.

If anyone has the actual code handy, that would be much appreciated.

Thanks
 
M

MA

Trial said:
The database I am working on will eventually have several security
levels. One level will allow the user to access tables & make
complete alterations to the system etc... they would also have access
to the toolbars in order to back up the database...

Is there any way to program a button to run the database backup??

I do not want ALL of my staff to have access to the design level of
the DB.. but I DO want any of my staff be able to backup the DB.

I know that the toolbox "create button" command has many options...
but running a backup is not one of them.

I imagine this is quite possible... just interested in how its done.

If anyone has the actual code handy, that would be much appreciated.

Thanks
Compact the backend when all the users are offline
Than instead of kill the old file you can duplicate the newone
You can find something ion
www.sitocomune.com It's an italian website

--
_ _
Ciao
MAssimiliano Amendola www.accessgroup.it
Cisa - Conferenza Italiana per Sviluppatori Access
Info: www.donkarl.com/it
 
6

'69 Camaro

The code is fairly easy:

Private Sub BackUpDBBtn_Click()

On Error GoTo ErrHandler

CommandBars("Menu Bar").Controls("Tools"). _
Controls("Database utilities").Controls("Back up database..."). _
accDoDefaultAction

Exit Sub

ErrHandler:

MsgBox "Error in BackUpDBBtn_Click( ) in" & vbCrLf & _
Me.Name & " form." & vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & vbCrLf & Err.Description
Err.Clear

End Sub ' BackUpDBBtn_Click( )

It depends upon the version of Access running this for whether or not it
will work successfully. (Access 2003 SP-1 doubles the size of the file
before it crashes, but it does make the back up.) However, one shouldn't
back up the currently open database. It's better to back up a closed
database from the current database.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
Top