S
Sheldon Penner
I recently installed an archiving system to a client's Access database which
copies records from certain tables to equivalent tables in a separate archive
database. Since these tables are related by key fields and foreign keys, I
copied the autonumbered ID fields of these tables as Longs into the new
tables. In doing so, I relied on the uniqueness of autonumber fields to
enable me to restore these records to the original database if required.
Unfortunately, Access Autonumbers are not unique. If a record is deleted,
its autonumbered ID number will be reused, making it impossible to restore
the original record and records in other tables related to it via foreign key.
The notion that autonumbered fields are unique and will continue to
increment upward even when lower numbers have been deleted is a common
misonception that I have seen several times in forums.
I'd be grateful for any suggestions on how to deal with this situation in my
archiving program.
copies records from certain tables to equivalent tables in a separate archive
database. Since these tables are related by key fields and foreign keys, I
copied the autonumbered ID fields of these tables as Longs into the new
tables. In doing so, I relied on the uniqueness of autonumber fields to
enable me to restore these records to the original database if required.
Unfortunately, Access Autonumbers are not unique. If a record is deleted,
its autonumbered ID number will be reused, making it impossible to restore
the original record and records in other tables related to it via foreign key.
The notion that autonumbered fields are unique and will continue to
increment upward even when lower numbers have been deleted is a common
misonception that I have seen several times in forums.
I'd be grateful for any suggestions on how to deal with this situation in my
archiving program.