Restoring backed up data

banshee343

New member
Local time
Tomorrow, 00:30
Joined
Mar 17, 2010
Messages
3
I have a database with a main table with an auto number primary key, a user has overwritten a few entries in the main table accidentally, instead of creating new records.

I have the original records in backed up copies of the database but because the primary key will conflict i cant just paste them back in unless i delete the over written data first. But that would mean id have to enter all that data that was used to overwrite in the first place again.

So in short is there a way to paste records from another database with a conflicting primary key? On the selected records that were affected there is also linked tables with records related, id like to restore the related records as well?

is there an easy way? It's only 3 records so it'd only take me 20min to restore manually but id like to know if there is a easier/efficient way for future reference?
 
It is hard to be specific without knowing the exact data structure. Test everyting you try on a copy of the database first.

You could move the records which overwrote the originals to a new key. Use an append query to write all fields except the autonumbered key from the required records. This will allocate them a new autonumber.

Then use an append to write the whole record from the backup to the current table. Appends will allow an autonumber to be written so long as it does not conflict with an existing record.

You would have to make sure any related records had the matching key changed too.

If referential integrity with cascading updates is enabled you can update values in one table and the related records in other tables will update too.
 
when you say an inexperienced user has over-written data, it begs the question - how?

did they make entries directly in the tables? if so they shouldnt.
otherwise, are your forms unclear, and allowing users to change things they should not.
 

Users who are viewing this thread

Back
Top Bottom