Restart Automatic Primary Key Index

  • Thread starter Thread starter Christopher Lusardi
  • Start date Start date
C

Christopher Lusardi

Hello, from the desktop menu, start, Microsoft Access 2003, and opening
a database, how do I restart the autmatic increment of the primary key?


If I delete all the rows of a database and leave just the headers, save
the database, re-enter the database it starts increment the key where
it left off before and not back at one!

Thank you,
Christopher Lusardi
 
Try to compact and repair before after you delete the records, always reset
the autonumbers counters

--
Saludos desde Oviedo (Asturias)

Juan Menéndez
Mastercafe S.L.
www.mastercafe.com
(e-mail address removed)

Si la información recibido te ha servido indicalo con otro post.
En caso de resolverlo por otros medios, indica la solución usada
ayudaras a otros y aprenderemos todos.
 
Mastercafe said:
Try to compact and repair before after you delete the records, always reset
the autonumbers counters

I'm really lost! Can you be so gracious and explain to me how do I do
this, taking me step by step to the ultimate conclusion?

Christopher Lusardi
 
Others have told you the mechanical way of accomplishing what you asked.

I wanted to point out that it shouldn't be necessary.

An Autonumber field is intended for one purpose only: to provide a
(practically guaranteed) unique value that can be used as a primary key.
24634, 24636. 24637 fulls that need just as well as 1, 2, 3 does.

No meaning should even be assigned to the value of an Autonumber field. In
fact, it's rare that their value is even presented to the user. Recognize
that Autonumbers are not guaranteed to be gap-free in numbering and, in
fact, if you ever have a requirement to replicate your database, the
Autonumber field will be converted to a random number, not a sequential one.
 
I agree in principe
however I do have several static tables (We'll have a discussion about
those -when/if I'm ever in your neck of the woods about those)
where I know the autonumber values & use them
as already stated though autonumbers are "stupdid"

Pieter
 
Christopher,

After you have deleted the records from your table, and you are back
looking at your Database Window...
1. Go to the Tools menu.
2. Point to Database Utilities.
3. Select Compact & Repair from the submenu.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top