vb123.com

Garry Robinson's Popular MS Access, Office and VB Resource Site

 

Home  Contact Us
Order our Software

RSS & Newsletter  
Join our XML/RSS Newsfeed or sign up for our informative newsletter on Office Automation, Access and VB topics
Read More

Get Good Help
If you need help with a database, our Professionals could be the answer
Read More

  Is Your Database Corrupt ?
If you have a corrupt database, Try our Access Recovery service

The Workbench  Find out who has your database open, start the correct version of Access, easy compacting and backups, change startup options, mde compile,  shutdown database Read and Download

The Toolshed 
Searchable help file comprising of all the information at vb123.com plus hidden downloads etc. Read More



The Toolbox

Libraries of software that we regularly import into our projects. Enhances the Toolshed More..


DryToast New
Backup and query your BaseCamp
® projects
Read More


Datamining/Graphs

Explore your data with this versatile graphing and data mining shareware tool. 
Read More

Garry's Blog
Find out a few other things that Garry has been writing about Microsoft Access. Read more

About The Editor Garry Robinson writes for a number of popular computer magazines, is now a book author and has worked on 100+ Access databases. He is based in Sydney, Australia
Contact Us ...

Search ...

or try our Aussie
 vb123.com.au
  mirror site

 

   Chapter 5: Backing up and Recovering Your Databases
Real World Microsoft Access Database Protection and Security - ISBN 1590591267
 

Overview

If you are involved with a multi-user Access database, you must learn how to back up the database properly. This chapter shows you how to check whether everyone has logged off, how to log off all users, how to back up a database properly, how to back up information while people are using the database, and then, when that fateful day comes, how to recover your information. As you progress through these topics, you will learn a good use for XML and even find out which objects in your database take up the most space.

The download material for this chapter includes forms and Visual Basic for Application (VBA) examples, as follows:

bullet

Functions to find out whether anyone is using the database.

bullet

A form to shut down the database at a set time.

bullet

A form that will safely back up a database by using the compact process.

bullet

A form that makes it easy for your users to compact their databases.

bullet

A form to unload all tables to comma-delimited format.

bullet

Two different ways to unload all tables to XML.

bullet

A form to back up all objects to text.

bullet

Special VBA recovery files that the text export procedures write automatically so that you can easily recover tables and objects.

 

  Note 

To find the demonstration material, open the download database for your version of Access—for example, grMAP2002.mdb—and select Chapter 5. Before running any samples that involve data, you may need to relink the tables to the Northwind database on your computer.

What You Must Know About Database Backups and Recoveries

Once again, I will provide two overviews about the important issues covered in this chapter. The first provides an overview that's applicable to all IT professionals, because everyone should be concerned with backups. The second summary covers extra topics that are relevant to the developer.

Overview for the DBA, IT Manager, and the Developer

Backing up and recovering an Access database would be easy if you could instantly get everyone to log off the database just before the system backup was due to commence. This process used to be called tape backup, but these days, databases can be backed up to all sorts of media, such as portable hard drives and DVD burners. If people are using the database when your system backup runs, you risk copying a database that is in an unstable state, which could cause you problems when you need to recover the database. This chapter provides solutions to that issue by showing you how to:

bullet

Make sure that your database is ready for a system backup.

bullet

Show you how to back up your database to another location, including the new Access 2003 backup menu command.

bullet

Provide insight into good backup procedures.

bullet

Back up and recover individual tables while the database is in use by using both text and XML formats and objects that use the text format.

bullet

Recover relationships, menus, and import/export specifications.

Of course, there are other reasons why you need to back up your databases, from computer equipment theft to the proverbial bus running over the laptop. One extremely good reason to use some of the object- and table-exporting software is that someone may unknowingly delete something or lock something while implementing database protection. Because problems like these always lurk around the corner, the more alternatives that you have, the more chances that you have to save lost information.

  Caution 

All the backup techniques described in this chapter can leave your security open to exploitation because you are creating yet more copies of the database and its objects for people to view. If you are serious about protecting and securing your backups, read Chapter 12 to find out how the operating system can protect the backup files. As part of this protection, you need to make sure that the Windows account that does the backups has write permissions for the backup directory.

Overview for the Developer

The gist of this chapter is to make it easy for you to incorporate backup routines into your own applications, and most of the material covered in this chapter will require that you integrate the demonstration material into a database. Apart from the benefits of the different backup processes discussed, you'll learn other important things:

bullet

Different ways to identify all the tables and objects in your database.

bullet

Another good use for XML.

bullet

The undocumented and powerful SaveAsText and LoadFromText methods.

bullet

Find out the very elusive facts about which are the biggest objects in your database, which is a very useful by-product of the object backup software in this chapter.

If that sounds like a lot of work, rest assured that most of the forms and functions from the demonstration database should not require too much customization when you add them to your database.

Other Related Access Backup Topics

Click here for a collection of related links to other relevant pages

Backing up Multi-User Access Databases

Creating Compressed (.ZIP) Archives of an Access database

Backing up Your Database by using Access 2003
 

Links >>>  Home | Search | Workbench | Orders | Newsletter | Access Security | Access professionals