Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error 1884 - uniqueness of primary key is violated
Message
From
02/05/1999 15:07:16
 
 
To
02/05/1999 13:36:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00214399
Message ID:
00214415
Views:
17
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform