Wrox Programmer Forums
|
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
 
Old April 4th, 2005, 04:08 PM
Authorized User
 
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to BigH140
Default 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 :)

 
Old April 6th, 2005, 10:21 AM
Authorized User
 
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to BigH140
Default

Doesnt anyone know how to help me with this small problem? :S

 
Old April 6th, 2005, 10:31 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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
 
Old April 6th, 2005, 01:01 PM
Authorized User
 
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to BigH140
Default

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

 
Old April 6th, 2005, 01:59 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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
 
Old April 7th, 2005, 07:57 AM
Authorized User
 
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to BigH140
Default

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

 
Old April 8th, 2005, 09:05 AM
Authorized User
 
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to BigH140
Default

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?
 
Old April 8th, 2005, 09:54 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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
 
Old April 8th, 2005, 12:39 PM
Authorized User
 
Join Date: Oct 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to BigH140
Default

excellente :D

any ideas on the other thing about adding a date to a filename though?

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

Try viewing these topics: http://p2p.wrox.com/topic.asp?TOPIC_...chTerms=backup
http://p2p.wrox.com/topic.asp?TOPIC_...chTerms=backup





Similar Threads
Thread Thread Starter Forum Replies Last Post
backing up through USB Shira VB Databases Basics 1 October 9th, 2008 06:57 AM
Problem Backing Up to Share rstelma SQL Server 2005 1 July 18th, 2008 04:20 PM
Microsoft JET Database Database Engine (0x80040E09 cannielynn0312 Classic ASP Professional 2 December 17th, 2007 02:50 AM
Backing up an MS Access Database donrafeal7 Access VBA 2 October 11th, 2006 11:33 AM
backing up all databases on sql Adam H-W SQL Server 2000 2 October 29th, 2003 01:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.