Data Access Worldwide Knowledge Base
Article ID 2204 Article Title HOWTO: Get the DD values that are used for simple validation Article URL http://www.dataaccess.com/kbasepublic/KBPrint.asp?ArticleID=2204 KBase Category VDF11 Date Created 01/05/2006 Last Edit Date 01/22/2006
Article Text
QUESTION:
In my DD class (via Database Builder) I can see that the simple validation is specified via Set Field_Value_Check. The VDF documentation specifies that it is a write-only property. I would like to be able to query the values at a certain moment in time. How do I do this?
ANSWER:
There is - as the help specifies - no command/function to retrieve the values. The DD class, however, retrieves the values to validate your input. With that knowledge it was simple to build the following function:
Function Field_Value_Check Integer iField Returns String
Integer iType iItem
String sValues
Get Field_Validation_Type iField To iType
If (iType = FA_VALIDATION_TYPE_CHECK) Begin
Move ((iField * FA_COUNT) + FA_CHECK_VALUE) To iItem
Get Value Of Field_Attributes Item iItem To sValues
End
Function_Return sValues
End_Function // Field_Value_Check
You can use this - after adding to the DDO or your DataDictionary subclass by coding:
Get Field_Value_Check Of oCustomer_DD Field Customer.Gender To sGenderValues
If the Customer table had a field called Gender and the simple validation was set to M|F you would get M|F in the string variable sGenderValues.
Contributed By:
Vincent Oorsprong
Company: Data Access Worldwide
email: vincent.oorsprong@dataaccess.eu
Web Site: http://www.dataaccess.eu
Email this Article
Email this Article to a Colleague
Send Feedback on this Article to Data Access Worldwide
Copyright ©2010 Data Access Corporation. All rights reserved.
The information provided in the Data Access Technical Knowledge Base is provided "as is" without warranty of any kind. Data Access Corporation disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. In no event shall Data Access Corporation or its suppliers be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages, even if Data Access Corporation or its suppliers have been advised of the possibility of such damages. Some states do not allow the exclusion or limitation of liability for consequential or incidental damages so the foregoing limitation may not apply.