Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error 1884 - uniqueness of primary key is violated
Message
De
02/05/1999 15:07:16
 
 
À
02/05/1999 13:36:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00214399
Message ID:
00214415
Vues:
16
Hi Rosana:

The basic problem is using a transaction date as a primary key. What happens if more than one transaction occurs on the same date?

Any time you attempt to enter the same primary key into a record more than one time, the "uniquenes violation" error occurs -- VFP does not care than one of the records is deleted.

The generally recommended practice is to not use a meaningful field as the primary key -- but to use a code-generated key in a field that the user cannot access. This prevents the user to generating an uniqueness violation.

If you must use the transaction date as the primary key, the code so that the user cannot enter a second trasaction with the same date. If the user has deleted a transaction, code so that the deleted transaction is recalled rather than a new transaction with the same date inserted.

Otherwise, I think the uniqueness violation error is going to be a contiuing headache for you.

regards,
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform