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
 
If I were going to do something like this I would probably create a table to store the date and time whenever the database is backed up. This could be done by running:

insert into last_backedup(backup_date) values(now());

whenever the database is actually backed up. Then, I would write code to compare the current date to the most recent date in the last_backedup table every time the database is opened. If the difference is greater than the desired amount I would run a macro (or maybe code) to do the actual backup.

The backup itself depends on what you want to back up. You could back up the entire database by making a copy of it based on the current date or whatever. Or you could update linked tables in another database where you store archived data or just append all recent data to locally stored tables.

After the backup, another macro/code/query could be run to delete any records that you don't want any more. And then finally, the date of the backup will have to be added to the last_backedup table as described.

I hope this gives you something to think about and points you in the right direction. There are many different ways to backup data and they're mostly implemented in different ways. Decide exactly what you want to do first and then go from there!

Good luck...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top