[AccessD] Corrupted Record
Rocky Smolin
rockysmolin2 at gmail.com
Wed Dec 6 08:33:59 CST 2023
Borge:
When I try to change the primary key field to auto number I get the message
"Once you enter data in a table, you can't change the data type of any
field to AutoNumber, even if you haven't added data to that field.".
It suggests "Add a new field to the table, and define its type as
autonumber. Microsoft Access then enters data in the AutoNumber field
automatically, numbering the records consecutively starting with 1."
I may have to do that and then change the foreign keys in the child tables
with a bit of code.
Thanks.
r
On Wed, Dec 6, 2023 at 5:20 AM Borge Hansen <pcs.accessd at gmail.com> wrote:
> Rocky,
> This is how I would do it,
> Make an empty copy of the table.
> Change the primary key field from being an auto number field to a long
> integer.
> Copy the records from the corrupted table up to the corrupted record, and
> manually add a record with a primary key value equal to the corrupted
> record, copy the remaining records from the corrupt table.
> In the new table with all the records copied across change the primary key
> field to an auto number field.
> I think that should do it.
> /borge
>
>
> On Wed, 6 Dec 2023 at 15:30, Rocky Smolin <rockysmolin2 at gmail.com> wrote:
>
> > Dear List:
> > I have a client who added a record to a table and that record is
> corrupted
> > (there are Chinese characters in it). You can't do anything with it. If I
> > try to delete the record I get the message "The search key was not found
> in
> > any record.
> >
> > I remember having this problem before and found a way to get it out. The
> > important thing is to preserve the PK because there are child records.
> >
> > I tried making an empty copy of the table, removing the key. Then I
> removed
> > the key from the original table, and copied and pasted all the records
> > except the last, corrupted one.
> >
> > That appeared to work but when I put the primary key back on the primary
> > key field, all of the PKs changed. It renumbered them starting with the
> > last record PK +1.
> >
> > Anyone know how I got rid of this corrupted record and preserve the PKs?
> >
> > MTIA
> >
> > Rocky
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list