Another Backup Question

J

Jeff C

I have search and read through what I could find on the subject here but
couldn't find an answer, maybe there is not one but here goes.

Access 2003: The tools/database utilities menu has a compact and repair
action which applies to the database that is currently open. The file menu
has a backup action that applies to the current database that is open.

I would like to attach each of these actions to the OnClick property of
separate command buttons which will make the process basically dumbproof for
the user of the database.

Would anyone offer a suggestion? Thank you
 
J

Jeff C

I am still trying to find a solution for the backup. Does anyone know the
code to use to call the backup function

located in the File Menu/Back Up Database in Access 2003?
 
J

Jeff C

From reading the help files it seems as though:

DoCmd.RunCommand acCmdBackup

should work, but it doesn't and I can't find any info to tell me if I am
using the method correctly.
 
J

Jeff C

I am trying to use: DoCmd.RunCommand acCmdBackup
but it returns a "Command or action not available" error.

I cannot find any other help reference to tell me what I am doing wrong.

Thanks in advance for advice.
 
J

John Vinson

I am still trying to find a solution for the backup. Does anyone know the
code to use to call the backup function

Jeff -

You CANNOT back up a database *from within that database*.

If the database is open at the time the backup copy is made, I
wouldn't trust the backup copy for ANY use. It's all too likely to
have been copied in an inconsistant state.

Make your backups *while the database is closed*, for example by using
the Windows Scheduler to simply run a .bat file copying the database.

John W. Vinson[MVP]
 
J

Jeff C

John: I hear what you are saying and I have read others responses repeating
your advice however, In Access 2003 by using the file menu backup database,
it allows an accurate backup to be made? How does this action/command work
and why can't it be activated with code?
 
J

John Vinson

In Access 2003 by using the file menu backup database,
it allows an accurate backup to be made? How does this action/command work
and why can't it be activated with code?

I've not used that feature, so I can't say. Presumably the programmers
set it up so that there aren't any transactions open which would cause
problems. Why it can't be activated with code I Simply Do Not Know; I
don't work for Microsoft and I'm not privy to the Access team's design
decisions.

John W. Vinson[MVP]
 
J

Jeff C

I will just keep trying to find a way to use the

Do.Cmd RunCommand acCmdBackup

function. Thanks John.
 
Top