By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,231 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

create dump files

P: n/a
Hello all,

I'm fairly new to access database(s), but I work a lot with mysql. I was
wondering if there is a script file out there that I can get a hold of that
will create a dump file. I need to be able to backup this data nightly and
would like it if the script file could name the file with that days date (so
each dump file would be unique). I thank you for any help that you might be
able to provide.

May 10 '06 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Since all of the tables, indexes, and even the referential integrity
settings are all contained in ONE FILE, then the concept of a dump file does
not really apply to ms-access.

In systems like mysql, you have all kinds of files and index files strewn
all over the place, and thus you need somting that will let you save the
data in some sensible matter. In addition, since you would have to stop, or
shutdown the server to copy a individual table file, you thus normally use
the data engine to export the data with a dump command.

Since ms-access databases are complete self contained in ONE file, you can
copy, or even email the WHOLE database by simply sending one file, and you
are done...

So, in your nightly back simply copy the file....

A simple windows batch file, or even a windows script will do the trick.

You could also have the batch file do a compact and a repair on the database
nightly, as that would re-index the data, and in fact kind of clusters the
data, since all tables will be reorganized in primary key index order.
However, compacting the mdb files is a separate issue from backing up.

So, no such concept as a dump file exists, or even applies on conceptual
level to ms-access.

To backup, you simply copy the mdb file. You don't even need ms-access
installed on the computer to do that!!!

Easily as pie..and none of the hassles of a server based system. ......

You can paste in the follwing windows script into a text file.

(aftger you are done pasting..just rename the file with a .vbs extenion, and
you have a windows script). This script can then be run by simply cliking on
it, or having the windows schdeuler run it every night at a time you

This one names the mdb file to the day of week, so

DOW1, DOW2...etc....

You would get a backup for each day of the week..and it would start
overwriing the file after one week

' ************************************************** *
' Script To Backup an Access MDB file
' ************************************************
'strFromFile = "\\mainserver\Rides\Rides_be.mdb"
strFromFile = "c:\program Files\Rides\Rides_be.mdb"
strTodir = "c:\Program Files\Rides\DailyBackup\"
strToFile = strToDir & "DOW" & datepart("w",DATE) & ".mdb"

Set objScript= CreateObject("Scripting.FileSystemObject")

' If Not objScript.FolderExists(strToDir) Then
' objScript.CreateFolder(strToDir)
' End If

if msgbox("Start a backup",1) = 1 then
objScript.CopyFile strFromFile, strToFile, True
' **** Inform User that Operation is Completed
strMsg = "Backup complete"
MsgBox strMsg,,"Finished"

End If

' **** Clean up
Set objScript= Nothing
Try pasting the above into notepad...change the appropriate file names..and
then save it with a extension of .vbs in place of .txt (I assume you like
all developers have file extensions turned on in windows so you can work
with file extensions, and change them!!!). After you rename the above to
..vbs, you can double click on it..and you just run your first windows

You would of course remove the msgbox stuff if you place the above script in
the windows scheduler. (if you use wscript.echo in place of the msgbox, then
your script can be run from the scheduler, and prompts will NOT wait for

Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
May 10 '06 #2

P: n/a
"Albert D. Kallal" <ka****> wrote in
Since ms-access databases are complete self contained in ONE file,
you can copy, or even email the WHOLE database by simply sending
one file, and you are done...

The exception to this is a replicated Jet database, which should
never be emailed or copied. If you want a backup, create a new
replica and synch with it whenever you want to backup your current

David W. Fenton
usenet at dfenton dot com
May 10 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.