General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
>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
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only