Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error handling - duplicate record
Message
From
03/08/2005 06:50:33
 
 
To
03/08/2005 06:40:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01038074
Message ID:
01038076
Views:
17
>In the click event of the ‘SAVE’ button I have the following code to trap errors.
>-----
>ON ERROR DO "w:\Talman develpment\bkbplus\errhand" with ERROR(), MESSAGE()
>select bkplcont
>tableupdate(.T.,.F.)
>on error
>------
>For some reason the program only catches the error when you exist the program. Then giving the foxpro error 'Uniqueness of index CN_CONTNUM violated'.
>
>
>In the load event of the form I 'use' the table with row buffering.
>
>---------
>SET MULTILOCKS ON
>
>USE bkplcont IN 0 SHARED ORDER CN_PORG
>lSuccess = CURSORSETPROP("buffering",3,"bkplcont")
>----------
>
>What must I do so that the duplicate error will be trapped when trying to ‘tableupdate’?

Irene,
ON ERROR DO "w:\Talman develpment\bkbplus\errhand" with ERROR(), MESSAGE()
select bkplcont

do case
case !TableUpdate(FALSE, FALSE) && one row
  && table validation error

otherwise
    go recno()  && dups and referential integrity

endcase
    
on error
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform