auto increment column

M

Mikerosoft

if i use an auto increment colm for a primary key will it change if
records are deleted?


10,000 records the next would be 10,001 but before it is entered, 50
rows are delete. what happens with my next rec? ok, i could have
delted rows too see, but is there ANY sercumstance that would change
the record id? 5yrs from now?
 
J

John Vinson

if i use an auto increment colm for a primary key will it change if
records are deleted?

No. Once the value is written to disk it won't be changed. In fact you
can't even edit it, in the table datasheet, on a form, or in an update
query.
10,000 records the next would be 10,001 but before it is entered, 50
rows are delete. what happens with my next rec?

The next record will *usually* be one higher than the highest record
ever entered. You could delete 50 rows, of 9995 records - it doesn't
matter; the next record will be 10001.
ok, i could have
delted rows too see, but is there ANY sercumstance that would change
the record id? 5yrs from now?

Well, you can't predict what new changes Microsoft might make over
five years - but my guess is that once an autonumber is entered into a
table, it will remain unchanged.

John W. Vinson[MVP]
 
M

Mikerosoft

I created a report from a table in excel, i emailed it to someone, they
wanted analysis so sent me the report back. THE # ARENT THE SAME! I
went back to the original email i sent the person and checked those
idkeys to the database. THEY ARE NOT THE SAME. how can this happen?

A few months ago, access 2003 tried to compact on close (access 2000)
method and i got an error message, that said the database was in an
unusable state i couldnt open with any version of access. I used an
oledb datareader in .net and read the data into a new db. i was a
striaght select from into statment, so i really doubt that would be the
culprit.
 
J

John Vinson

I created a report from a table in excel, i emailed it to someone, they
wanted analysis so sent me the report back. THE # ARENT THE SAME! I
went back to the original email i sent the person and checked those
idkeys to the database. THEY ARE NOT THE SAME. how can this happen?

A few months ago, access 2003 tried to compact on close (access 2000)
method and i got an error message, that said the database was in an
unusable state i couldnt open with any version of access. I used an
oledb datareader in .net and read the data into a new db. i was a
striaght select from into statment, so i really doubt that would be the
culprit.

There are several possible places that the data could have changed.
You say you sent a Report (not the content of the table directly) -
might that Report have had calculated fields, or a sequential row
number, not drawn directly from the table? Or, of course, once the
data is in Excel, Access has NO control; might the recipient have
edited the data?

Of course if the database were corrupted, indexes might have been
damaged; but I really doubt very much that the value actually stored
in the table would have changed.

John W. Vinson[MVP]
 

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

Top