Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handling issue
Message
From
01/08/1999 15:21:57
 
 
To
01/08/1999 14:51:42
Antonio Gubaira
Ingenieria Y Sistemas
Valencia, Venezuela
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00248688
Message ID:
00248689
Views:
23
Hi Antonio

>If I try to add a new record with a repeated value in this field, the error handling routine in the "updaterows" method of the "txtbtns" container, traps the error and clears it before I get the chance of evaluating the ocurrence of the error by means of the ERROR() function in my form.

You wouldn't handle this in an error event, but catch it in the Valid event of the Primary Key's textbox.

>Although I know it is not a good practice to let the user submit values for a primary index field

Your right, is there any special reason your doing it this way? My supplied framework has a nextid table and a nextid method. The default value of the PK field is: nextid('fieldname'), then the nextid program gets the newest id for that field out of the table and adds one to it. There should be no reason the user knows the PK even exists, however I don't know your particular scenario.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform