>I have a database with several tables, the tables have principal indexes, but when I want to add a record with a key value that exist but is deleted,i can't because the key must be unique.How can I solve this problem ?
You could add a filter to index expression "for !deleted()". But this is not supported in utilities like gendbc.prg. (I sense your key is integer) Instead you could make a simple trick and replace deleted ones with their negative values :
replace pk with pk*-1 for deleted()
Later you could add :
replace pk with pk*-1
to your delete routine.
Cetin