Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>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
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