Board index » delphi » Auto increment field

Auto increment field

Anyone know why I would be getting key violation on an auto icrementing
primary key field when I've only got the latest record at a value of 1259?
No matter what I do for some reason, I can't get out of it?
 

Re:Auto increment field


Thanks for all the answers guys! lol

Seriously, after a whole morning of searching I found the answer on a
NON-Borland site. Apparently a common problem.

If any one else afflicted, let me know.

Re:Auto increment field


I've had this problem once (paradox tables ?)

Probably your table got corrupted and the autoincrement field tries to
increment to a value that already exists in the table, hence the
key-violation. The record that already exists may even be a deleted one, so
it might no longer be visible...

I played around with the table a bit in the Database Desktop (e.g. delete
the last record and then do a restructure with the 'pack table' checkbox
set, or remove and reinstall the primary index...) This worked for me......

That's paradox for you ! Are you using the tables in a networked environment
? Don't do that !

Regards, Jaap

Quote
"Edward Dekkers" <edward.at.tripled.iinet.net.au> wrote in message

news:3b9c4fba$0$18348@echo-01.iinet.net.au...
Quote
> Anyone know why I would be getting key violation on an auto icrementing
> primary key field when I've only got the latest record at a value of 1259?
> No matter what I do for some reason, I can't get out of it?

Other Threads