Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Primary Key no longer assigning consecutive #'s 1

Status
Not open for further replies.

monkeysee

Programmer
Sep 24, 2002
201
US
I have a simple table for addresses. The AddressID is the primary key. Presently there are 4900+ records, last primary key # assigned was 4951.

When trying to add a new record, I am getting a duplicate primary key error. I watched to see what # access tries to assign to the new record and, indeed, it is trying to assign a record to a number that already exists (which was in the 4500 range)!

What can be done to remedy this?
 
First, I'd try a Compact/Repair the database.
If the problem still persists, you may run an action query like this:
ALTER TABLE yourTable ALTER COLUMN AddressID COUNTER(4952,1);

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,
Compact/Repair did not fix.
But your query did! Thanks so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top