Backup from a command line?

J

Joe M.

I would like users to be able to create a backup from a shortcut on our
shared drive instead of from within Access. I don't want to just copy the
file but rather create a backup like Access does (with the date as part of
the file name). Can someone help?

Thanks!
Joe M.
 
A

Al Campagna

Joe,
Sounds like some new 2007 "backup" feature, which I haven't used yet...

Since your doing this from outside Access, why not just use
a freeware backup program that you can schedule (like Cobian Backup).
The Created/Modified date would always indicate what Date and Time
the Backup occured.
There may even be some backup apps that allow you to "name" the
backup file "on the fly"... BUT... most backup apps consider that the Create
D/T
does that already... just not in the file "name."
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
J

Joe M.

Al,

In our environment we are extremely limited and can't download or install
any software. We're using Access 2003. Under TOOLS > DB Utilities is the
backup function. What we're doing is having the users update the DB from
spreadsheets that are imported into the DB using shortcuts to Access macros.
The macros work fine but as a precaution I want the user to backup the DB
before doing the import in case something goes wrong and I dont want the user
going into Access to do the backup since most of them are ignorant of the
admin and decelopment side of access. All they're used to is seeing the
forms, reports etc.

Thanks,
Joe
 
D

david

You can use VBScript of PowerShell to do a backup
"like Access does", which is to say "compact to a new file".

Of course, you don't have to compact: you can backup by
just making a copy of the file. But if you want to compact,
something like this vbscript (Air Code)

dim dbe,Oldname, NewName
Oldname = "mydb.mdb"
NewName = "mydb." + str(Date) + ".mdb"
set dbe = CreateObject("dao.dbengine.36")
dbe.CompactDatabase OldName, NewName

(david)
 
D

De Jager

david said:
You can use VBScript of PowerShell to do a backup
"like Access does", which is to say "compact to a new file".

Of course, you don't have to compact: you can backup by
just making a copy of the file. But if you want to compact,
something like this vbscript (Air Code)

dim dbe,Oldname, NewName
Oldname = "mydb.mdb"
NewName = "mydb." + str(Date) + ".mdb"
set dbe = CreateObject("dao.dbengine.36")
dbe.CompactDatabase OldName, NewName

(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