Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uniqueness of 'primary_key' is violated.
Message
 
À
05/09/2004 04:30:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00939529
Message ID:
00940150
Vues:
30
Hi Don,
We've had this problem also - the way we worked around it was to replace the cust_no with a reasonably unique value (eg SYS(2015)) as part of the DELETE. Not elegant, but overcomes the problem. Can be tricky if you have linked records eg if you have contacts/events/logs/etc linked to the customer record, but you can usually let the DBC cascade the change through. If your cust_no field is large enough you might be able to append the unique value to the customer code - this helps if you ever need to RECALL it and want to find the record easily based on customer code. Also it guarantees uniqueness (for the rare occurrence when two records are deleted in the same millisecond and SYS(2015) returns the same value).

Also depending on your delete code you will probably have to UPDATE the record before you DELETE it.

However, you may be able to replace the cust_no with a trigger on the delete, rather than doing it in form code (but we haven't tried this yet)...
Craig
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform