Mike Yearwood
Toronto, Ontario, Canada
>>Has anyone seen this behavior?
>>
>>
>>I have a CANDIADTE KEY on a customer table called cust_id
>>
>>if I delete it, and set deleted on VFP3 still takes it into account when
>>appending new records and I always get the great message
>>
>>INDEX KEY VIOLATED....
>>
>>Does anyone know why? or how to fix it or get around it?
>
>this is not really strange and quite expected actually
>when you delete a record in VFP it is not erased from the table (until you
>PACK or something like that)
>and basically you can RECALL that record
>this is why you can't have a new key with the same value..
>this is also one way of solving your problem by recycling the deleted
>record with the new values..
>
>
>Arnon
The answer is to build your candidate key on an index expression like INDEX ON FIELDNAME TAG CKFIELDNAME CANDIDATE FOR !DELETED() and also to INDEX ON FIELDNAME TAG FIELDNAME. VFP will ignore deleted records in the CK checks. I add the second index tag because VFP will not use tags that have .NOT. in them (or the exclamation mark) in Rushmore operations.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement