 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 4th, 2005, 04:08 PM
|
|
Authorized User
|
|
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Backing up a database
Is there a way to automate the database backup function in MS Access? Either at a certain tme each day...or just saved to a pre-specified location when a button is pressed on a form for instance.
i know you can just go to file -> back up database, but the database i am creating needs no human interaction apart from clicking buttons and typing in boxes. they shouldnt have to look for a location to backup the database to. Just one click of a button and it automatically saves the database to a new location.
thanks in advance :)
|
|

April 6th, 2005, 10:21 AM
|
|
Authorized User
|
|
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Doesnt anyone know how to help me with this small problem? :S
|
|

April 6th, 2005, 10:31 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
For what it is worth...
I am sure this is possible somehow, but I was wondering if scheduling a task on your server to back the database up at a specific time was an option? All of mine are stored on a server which is completely backed up nightly, so this has never been an issue for me.
Mike
EchoVue.com
|
|

April 6th, 2005, 01:01 PM
|
|
Authorized User
|
|
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
its not going to be on a server, just one PC. I need it to be able to done manually, using a macro function or VBA in MS Access
|
|

April 6th, 2005, 01:59 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
It is still possible with just a PC, and from what I just tried, really easy to setup, and it won't make a difference if the Access Application is running or not. In fact if you are using XP, you don't even need to be logged in, so you could have it run at midnight if you keep the computer turned on.
I just wrote a batch file containing one line
xcopy D:\DeveloperPriority.mdb D:\test\ /Y
This backs up D:\DeveloperPriority.mdb to the test folder in D: The /Y option at the end forces an overwrite if the file already exists.
Just go into the Control Panel, Scheduled Tasks and it should walk you through the process.
Mike
EchoVue.com
|
|

April 7th, 2005, 07:57 AM
|
|
Authorized User
|
|
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thats a good idea, thanks a lot :) but if anyone does know how to do it in a macro, or VBA code within the actual database, i will be able to use both methods for automatic and manual backup.
thanks :D
|
|

April 8th, 2005, 09:05 AM
|
|
Authorized User
|
|
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ok when i use that batch file i get this message:
Does F:\Andy's_Homework\ICT\Site\SchoolSystem.mdb specify a file name
or directory name on the target
(F = file, D = directory)?
I tried putting /F on to automaticaly create a file insted of a directory, but it didnt work. Any ideas on how to automatically make it create the file?
Also, is it possible to add the current date onto the filename when it is copying it without changing the batch file everyday?
|
|

April 8th, 2005, 09:54 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
That is a puzzling one, because I kept getting that message as well. I got around it by not specifying a 'copy to' filename, and then putting a \Y option at the end to force the overwrite.
xcopy D:\DeveloperPriority.mdb D:\test\ /Y
Hope that helps
Mike
EchoVue.com
|
|

April 8th, 2005, 12:39 PM
|
|
Authorized User
|
|
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
excellente :D
any ideas on the other thing about adding a date to a filename though?
|
|

August 8th, 2006, 09:09 AM
|
|
Authorized User
|
|
Join Date: Aug 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
|
 |