>How to handle this error??
>
>Even I have an error handler, to clear this error....
>it still got problem and crash my system.... ~>_<~
>
>I got this error when TableUpdate(.T.) that user has key-in dup. key!
>Code of Update will be:
>
>if TableUpdate(.t.) == .f.
> messageb('TableUpdate error!!',48,'Fail to Update')
> TableRevert(.t.)
>endif
>
Hi,
You can use AERROR() function to determine last error occured.
Amend your code just like this
IF TABLEUPDATE(.T.) = .F.
LOCAL ARRAY laerr[1]
AERROR(laerr)
MESSAGEBOX(laerr[1],48,'Fail to Update')
TABLEREVERT(.T.)
ENDIF
You may want to give user chance to amend the key-value. in such a case
remove TABLEREVERT(.T.) and let the user save the data again after changing
key-values.
Bye
Jayesh
- Jayesh