Board index » delphi » Key Violation with autoincrement fields

Key Violation with autoincrement fields

I'm working on a database application using Borland C++ Builder. Its
basically the same as Delphi as most of you know. Anyway, one of the Paradox
tables I created in Database Desktop has an autoincrement field which is the
primary key. __How is it possible to get a key violation__? Everything was
working fine until today, when I get a key violation every time i try to
create a new record.

Thanks, Yevgen.

 

Re:Key Violation with autoincrement fields


Hi !

Your paradox table has proboably gone corrupt. You may do the following:

1) In database Desktop, open the table with Table | Restructure.
2) Change AutoInc fieldtype to Integer
3) Save table
4) Repeat the operation, but now set field type back to Autoinc.

Theis should fix it.
The above procedure is the only way (AFAIK) to "reset" autoinc cunter
when you clear a table.

Good luck !
--
Bjoerge Saether
Consultant / Developer
Asker, Norway
bsaether.removet...@online.no (remove the obvious)

Yevgen Voronenko skrev i meldingen <277d0$1127.399@XAVIER>...

Quote
>I'm working on a database application using Borland C++ Builder. Its
>basically the same as Delphi as most of you know. Anyway, one of the
Paradox
>tables I created in Database Desktop has an autoincrement field which
is the
>primary key. __How is it possible to get a key violation__? Everything
was
>working fine until today, when I get a key violation every time i try
to
>create a new record.

>Thanks, Yevgen.

Other Threads