Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 21st, 2004, 02:01 PM
Authorized User
 
Join Date: Mar 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default back up of the DB

Hi,

do you know how I can do to do an automatic back up of the DB when the user clic on the "Quit application" button in the main menu.

Thanks


Patrica Molard
__________________
Patrica Molard
 
Old April 21st, 2004, 06:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if what you're wanting is for the DB to be copied from one location to another, then here's some ideas:

If your DB is split into frontend and backend:
On the "Quit Application" button, put a FileCopy statement in before the Quit Statement, such as :
Code:
Private Sub cmdQuit_Click()
  FileCopy "C:\YourFile.mdb", "D:\YourBackupFile.mdb"
  DoCmd.Quit
End Sub
If it's not split, then you'll probably have to have the DB open another Access file that copies the original one to the backup, such as:
Code:
Private Sub cmdQuit_Click()
  Shell "msaccess.exe C:\MakeBackup.mdb"
  DoCmd.Quit
End Sub
And in MakeBackup, have an autoexec that copies the file then closes itself, basically the same code as in the first example.

Another option is to have it compact to a new location when it closes.


I am a loud man with a very large hat. This means I am in charge
 
Old August 8th, 2006, 09:18 AM
Authorized User
 
Join Date: Aug 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by Steven
Another option is to have it compact to a new location when it closes.
How would you go about doing this?






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to transform an MDF db into a permanent db? hertendreef SQL Server 2005 2 April 10th, 2007 03:57 PM
Finding the DB Sailor.mdb of Beginning ASP DB book anna Classic ASP Databases 2 August 5th, 2006 01:13 PM
From DB back to Jpg Format reyboy VB.NET 2002/2003 Basics 3 April 20th, 2005 05:32 AM
Retrive values to Drop down list from DB when Back choudhmh Pro VB.NET 2002/2003 0 January 12th, 2005 10:44 AM
history.back or hitting the back button won't work lian_a Classic ASP Basics 4 July 29th, 2004 12:14 AM





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