Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Validation Rules
Message
 
To
29/04/1998 17:52:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00095820
Message ID:
00095858
Views:
20
>I have a table with a charater field called "ID_NAME". How do I set the index value and create a validation rule to check for uniqueness of ID_NAME. I want to display a custom error message when this rule is violated..
>
>Thanks,
>
>Bob

Bob, if I understand your questions, then the index is simply on ID_NAME (INDEX on ID_NAME tag NAME). If you want the validation checked internally, set the NAME index to be PRIMARY. You can add your own validation function and message in the table designer.

However, most of us (see many past threads) use an outside table which holds the last used (or next) Unique ID for each table. A function locks the record, increments the ID (by any function you choose) and then unlocks the ID table returning the new ID value. These IDs are NEVER part of any user-entered field. They are completely separate from the actual data.

HTH
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform