MS Access does not have functionality to recover or UNDO or UNDELETE deleted records. It is easy to lose data when you mistakenly forget put () between AND and OR in WHERE clauses. There are several options to cope with it, for instance creates trail tables or backup whole database regularly. Here is another option which might be easier, better and more practicable:
1. Centralize all DELETE queries into one for better management purpose with unique query name. Since MS Access does not allow table and column name as parameters, this DELETE query will be hard coded every time when you try to delete any record.
2. Never run this query directly.
3. Put this DELETE as part of a Macro.
4. Within the Macro, before the DELETE query, put some backup queries for the table you are working with or all related key tables. The simplest way to code backup query is:
SELECT *
INTO BackupTable1
FROM WorkingTable
;
Thus, you only backup table before the deletion and can be recovered once you find the fatal mistake. You can only backup one copy only since the table name in Macro cannot be changed. Another stupidity of Microsoft.
No comments:
Post a Comment