> So I simply imported the tables into Access 2000 for the back end and
> I have just discovered that one of my tables had
> reset the next autonumber value to 1.
> Questions:
> How could this have happened?
If you import a table _structure_ then the seed will start from scratch.
If you imported the table with its data then the seed will fall back to
(highest existing autonumber + 1). In effect you are just creating a new
table.
> I had repaired
> and compacted the front and back ends
Compacting a db with one or more empty tables will reset the autonumber
in that table or those tables.
I don't understand how it matters, though. If you want to start with an
empty database, then it's appropriate to let all counters restart. If you
want to start with a seeded database, then you will need some method of
initialising it, which in turn means that you think very carefully about
what data you need to import, in what order, and how. This is a technical
procedure called Data Migration.
All the best
Tim F
Reggie Laffond - 26 Jan 2005 21:10 GMT
I might have given too much information and made my question unclear.
Basically I had a table with 939 records in it with the primary key (auto
number field) from 0 to 942 (with three missing numbers caused by deleted
records). I compacted and repaired the database.. The next day when I tried
to add a new record to the table the auto number kept coming up 1 which
already was used in the first record in the table.
I just want to know if "repair and compact" could reset the auto number seed
even though there were 939 record in the table. Or is there some other known
bug that could cause this to happen. I just want to prevent it in the
future.
Thanks!
> > So I simply imported the tables into Access 2000 for the back end and
>
[quoted text clipped - 25 lines]
>
> Tim F
Jeff Conrad - 26 Jan 2005 22:41 GMT
Updating your Jet file should solve this issue I believe. See:
ACC2000: AutoNumber Field Duplicates Previous Values
After You Compact and Repair a Database
http://support.microsoft.com/default.aspx?scid=kb;en-us;257408

Signature
Jeff Conrad
Access Junkie
Bend, Oregon
> I might have given too much information and made my question unclear.
>
[quoted text clipped - 40 lines]
> >
> > Tim F
Reggie Laffond - 27 Jan 2005 21:07 GMT
Will do. Thanks for the quick reply! Great newsgroup!
> Updating your Jet file should solve this issue I believe. See:
>
[quoted text clipped - 46 lines]
> > >
> > > Tim F
Jeff Conrad - 27 Jan 2005 22:35 GMT
You're welcome, glad to help.
Come back any time.

Signature
Jeff Conrad
Access Junkie
Bend, Oregon
> Will do. Thanks for the quick reply! Great newsgroup!
>
[quoted text clipped - 63 lines]
> > > >
> > > > Tim F
Tim Ferguson - 27 Jan 2005 19:25 GMT
"Reggie Laffond" <Anyone@prodigy.net> wrote in news:e$nuFu#AFHA.1296
@TK2MSFTNGP10.phx.gbl:
> . I compacted and repaired the database.. The next day when I tried
> to add a new record to the table the auto number kept coming up 1 which
> already was used in the first record in the table.
As Jeff says, this is a bug. Update Access with latest service packs.
All the best
Tim F
Reggie Laffond - 27 Jan 2005 21:07 GMT
Will do. Thanks for the quick reply! Great newsgroup!
> "Reggie Laffond" <Anyone@prodigy.net> wrote in news:e$nuFu#AFHA.1296
> @TK2MSFTNGP10.phx.gbl:
[quoted text clipped - 8 lines]
>
> Tim F