Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validation and candidate key
Message
From
25/01/1999 10:31:55
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00179806
Message ID:
00179814
Views:
20
>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
Map
View

Click here to load this message in the networking platform