Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic backup of a database and delete records

Status
Not open for further replies.

vmolasi

Programmer
Aug 13, 2003
12
FR
Hello friends,

I have an application wherein I have to automatically backup a database after a specific time duration has elapsed. Example a week , a month or a year. After doing this backup I also want to automatically delete records from a specific table.

Can anyone advise me on how this can be achieved in Access 97. Any help is greatly appreciated as I am new to Access programming.

regards
 
I won't be able to discuss the specific coding, since it's a big subject. Instead, I've suggested the steps you might take.

You could develop a small application with one form. Open the app via Windows Scheduler; daily, weekly, etc.

Within the form's load event, have your code copy the target mdb file to your backup folder using sendkeys. Your app shouldn't link to any of the target mdb's tables, or the copy will fail.

This part gets tricky. Access won't know when the copy operation is completed, so you'll need a loop to check for the existence of the file using the dir function.

When the file is found, the copy step's done, and you can perform the record deletion using a delete query. Use the delete query's source database property to connect to the target mdb.

Having said all that, you could save yourself the trouble of coding the backup by getting a copy of FMS Inc.'s Total Access Backup product.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top