Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unique ID Violated With Add/Delete
Message
 
À
15/06/1998 16:04:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00108257
Message ID:
00108370
Vues:
36
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform