Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field that failed field validation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00093813
Message ID:
00094024
Vues:
52
Hey Doug,

>Does anyone know of a way to id which field actually failed the field validation.
>
>Example: Doing an insert into a table that has 5 fields. Each field has a field validation rule. If one of the fields fail its validation, is there some way of knowing which field actually failed besides the returned error message. I need to be able to log the failure and move on to the next record.

How about checking each field's validation rule BEFORE you try to commit the update using DBGETPROP()?
FOR i = 1 TO FCOUNT()
   lcRule = DBGETPROP(ALIAS()+".FIELD[i]","FIELD","RuleText")
   IF !EMPTY(lcRule)
      IF !(lcRule)
         Log Problem field information here!!!
      ENDIF
   ENDIF
ENDFOR
Or something very similiar to the above.

HTH,
Jim Duffy
Microsoft MVP
INETA Speaker
TakeNote Technologies
Developer's Choice Award Winner for Best Training Company
Specializing in VB.NET, ASP.NET, VFP, and SQL Server Training and Development
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform