Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Declarative Validation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00239695
Message ID:
00240005
Vues:
32
>>The Visual FoxPro documentation states:
>>
>>"For example, you might create a rule that compares the entry in the postal_code field of a table against a lookup table that contains the postal abbreviation codes for your country, and rejects any value that is not already present as a valid postal code abbreviation."
>>
>>I am try to accomplish a task similar to the postal abbreviation code validation. Could someone tell me what I need in my Field Validation Rule? An example based on the postal abbreviation code would be wonderful. Thank You.
>
>You need to put the name of a function in the rule
>
>DBSETPROP("MyTable","Table","RuleExpression","PostalCodeValidate()")
>
>Then create a stored procedure in your dbc that does your checking for you, and returns .T. or .F. based on what it finds.
>
>FUNCTION PostalodeValidate
>IF !USED('PostalCodes')
>USE PostalCodes IN 0
>ENDIF
>RETURN SEEK("CurrentTable.Code","PostalCodes","Code")
>ENDFUNC
>
>Or something like that. Might want to close the table if it was not open before and such and such...


Thank You. I had been unable to find a good example of this being done anywhere.
Nebraska Dept of Revenue
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform