Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique ID Violated With Add/Delete
Message
 
To
15/06/1998 16:04:03
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00108257
Message ID:
00108370
Views:
37
From the approach you are taking, I would try working with a customized Error handling routine to try the following. Although brief, I hope to open the concept for you to expand upon...
llOk = .T.
lcOldErrorRoutine = on( "error" )
begin transaction
llSuccess = TableUpdate()
if not llSuccess
  aerror( laError )
  if laError = 1884
    */ Uniqueness error number
    */ RE-Generate new number...
    llOk = .F.
  endif
endif
rollback

on error &lcOldErrorRoutine
return( llOk )
You may or may not want to rollback depending on when the attempt is being checked... I would try it during a loop when determining the next available number... Then check again when user tries to save the changes.
Previous
Reply
Map
View

Click here to load this message in the networking platform