Borislav gave you the answer. Personally I rarely delete records, instead I have a logical field called Reusable, with a matching binary index tag. Whenever I need to add a record, I always use something like this
select top 1 pk from mytable where reusable order by reusable into array laPk
if _tally>0 && A reusable record is found
update mytable set field1=myvalue1, field2=myvalue2, reusable=.F. where pk=laPk
else
insert into mytable (field1, field2, pk) values (mavalue1, mavalue2, generateGuid())
endif
My pk is always a guid, created by the generateGuid() function. Remember, a Primary key shall not be meaningful, but guaranteed to be unique, which is what guid stands for, Globally Uniqie IDentifier.
>(Reviving the topic from yesterday)
>How can I check a table if it has any deleted records?