Gary Williams
06-10-2005, 08:04 PM
Hi All,
I have an access database which I use to hold enquiries, orders dispatched, customer details, etc. Every month I do a complete backup of the database and then delete all enquiries older than 6 weeks from the 'live' database. This keeps the database relatively small and keeps the application happy.
What I now need to do is create a script, buy a script or buy a commercial product that will create a master database (from the first enquiry) so I can do some analysis.
This is what I need to happen.
First I will manually create a master database by copying the oldest backup database available, ie, "backup#January.mdb" to "masterdatabase.mdb". I'll tell the script the filename of the next backup database, ie, "backup#February.mdb". The script will check the record ID (primary key) of each record in this database (backup#February.mdb) against the record ID's in the master database and if a record is missing, it copies this record back into the master database from "backup#February.mdb".
If a record is found in both databases, the script needs to compare a date field (recordedited). If the master database has the later date stored, the record is left alone (in the master). If the copy of the record in the master is the older copy, it must be overwritten from the backup database.
Obviously I should have got my backup system sorted out at the outset!
Regards
Gary
I have an access database which I use to hold enquiries, orders dispatched, customer details, etc. Every month I do a complete backup of the database and then delete all enquiries older than 6 weeks from the 'live' database. This keeps the database relatively small and keeps the application happy.
What I now need to do is create a script, buy a script or buy a commercial product that will create a master database (from the first enquiry) so I can do some analysis.
This is what I need to happen.
First I will manually create a master database by copying the oldest backup database available, ie, "backup#January.mdb" to "masterdatabase.mdb". I'll tell the script the filename of the next backup database, ie, "backup#February.mdb". The script will check the record ID (primary key) of each record in this database (backup#February.mdb) against the record ID's in the master database and if a record is missing, it copies this record back into the master database from "backup#February.mdb".
If a record is found in both databases, the script needs to compare a date field (recordedited). If the master database has the later date stored, the record is left alone (in the master). If the copy of the record in the master is the older copy, it must be overwritten from the backup database.
Obviously I should have got my backup system sorted out at the outset!
Regards
Gary