Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Validation and candidate key
Message
De
25/01/1999 10:31:55
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00179806
Message ID:
00179814
Vues:
21
>Index Eff_date on Eff_date is a candidate index.
>Buffering mode is optimistic table buffering.

>lRet = !Seek(This.Value,"ratememb","eff_date")
>But On Seek() I got error on uniqness violation.

When you set up a candidate key you are asking the database to enforce that the key is unique.

When you SEEK, you are moving of the new record your user just created which causes the buffer to update the table... the database tries to add the value to the index and determins it is not unique, and send this message.

There are several solutions to this:

1. Just let the .DBC check for uniqueness.
2. As John said, don't bind the control to the database.
3. Open the file AGAIN to check for the value
4. Use a regular key so when you seek in the current table the .DBC doesn't check for uniquness.
5. Use Table buffering instead of row buffering so moving the pointer doesn't force a tableupdate.

BOb
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform