Can you save an MDB file using VBA?

D

David Anderson

I have an Access 2003 application that is typically used for large amounts
of data entry in a relatively short period of time by multiple users - all
accessing the same back-end MDB file. I am looking for a way to back up this
MDB file to a different PC on the network on a regular basis, perhaps by an
automatic backup at predefined intervals.

This would require some VBA code to save the file. However, I'm struggling
to find something suitable. My first thought was to use DoCmd.Save, but that
does not seem to apply to a database object.

Any suggestions?

David
 
J

Jeanette Cunningham

David,
You can do a compact and backup.
There is a sample database that shows how to do this here:
http://www.rogersaccesslibrary.com/TableOfContents3.asp#B

BackUpWithCompact.mdb ( intermediate )
This sample illustrates how to back up a database using the Compact Method.
It creates a backup file called "BackUpWithCompact2kXX_XX_XXXX.mdb" with the
X's representing the data. It puts this file in the same directory as the
database. It also looks f

Jeanette Cunningham
 
D

David Anderson

Jeanette,
Thanks for the link. I've just downloaded this sample database and had a
very brief look at the code. It's clearly much more than a one-liner to
achieve this sort of thing. Now I don't feel quite so bad at not knowing how
to do it!

It will take me a while to extract what I need for my particular purpose,
but it certainly looks like a potential solution.

Thanks again for a speedy response to my post,
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top