Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field that failed field validation
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00093813
Message ID:
00094024
Views:
51
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform