Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding duplicate keys
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00176022
Message ID:
00176100
Views:
31
>>I guess I'm not clear on error trapping. Do I do something like this:
>>
>>ON ERROR llNotSaved = .T.
>>TABLEUPDATE()
>>IF llNotSaved
>>*Error message
>>ON ERROR
>
>I think I'd rather write it as:
>lnError = 0
>lcOldError = ON("ERROR")
>ON ERROR lnError = ERROR()
>TABLEUPDATE()
>IF lnError != 0
>    DO CASE
>        CASE lnError = ...
>            WAIT WINDOW "Duplicate value found"
>        CASE lnError = ...
>            WAIT WINDOW "Could not update record"
>        OTHERWISE
>            WAIT WINDOW "Unexpected error of type " + ALLTRIM(STR(lnError)) + " detected"
>    ENDcase
>ENDif
>ON ERROR &lcOldError
Another good idea...

Thanks,

-Michelle
Previous
Reply
Map
View

Click here to load this message in the networking platform