Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking some field for uniqueness
Message
 
 
To
12/06/2001 16:23:00
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00518556
Message ID:
00518596
Views:
11
>>We have the similar code in our classes, but I realized, it is not sufficient, since it doesn't check for buffered changes.
>
>Nadya,
>
>If you do a seek() or COUNT in the same table (i.e., without re-opening it), you run the risk of getting error messages, caused by the fact that validation is carried out before you actually want to save the record.

Haven't thought about it. So, I have to add some error trapping too. The problem becomes more and more complicated...

>
>The philosophy I apply is to check for changes only when the user tries to save changes. This has several advantages, specifically, you wouldn't need to worry about buffered changes.

Say, user adds several records, some with the same name. Now you can not save them, so he/she spent time in vain. This is not good.

>However, I realize that if you want to check for changes earlier this solution may not be perfect.
>
>Regards, Hilmar.

Thanks again. So basically COUNT FOR +Trapping uniqueness of index is violated error should work. I have to think about it and discuss with my colleagues. I can make changes for the particular form, but it's better to make the changes on the class level.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform