The information in this article applies to:
SYMPTOMSReturning an invalid datatype in the _Access method of an object's property results in the following error when you reference that property:
RESOLUTION
To avoid this error, make sure that the datatype returned is valid for the
property being accessed.
In the rare instance where you need to return a value other than the
property's value, changing the value of the property, and returning the
property ensures that you are storing the value for future comparison.
NOTE: You should consider changing the value of a property in the property's _Access method an extreme case, and make sure you fully document the change. STATUSThis behavior is by design. MORE INFORMATIONNOTE: The example we provide in this article is not the only place this behavior occurs. Any access method that tries to return an invalid datatype for the property fails with the error. Steps to Reproduce BehaviorRun the following sample code from a program file.Notice that the RETURN statement in the object1.INTERVAL_access method returns nothing explicitly. In Visual FoxPro, unless you specify what to return, FoxPro returns a logical true or false (.T. or .F.). This is not a valid setting for the Interval property of the Timer object. This results in the error "Datatype is invalid for this property," and Visual FoxPro cannot instantiate the object.
Additional query words: kbVFp600 kbOOP
Keywords : |
Last Reviewed: December 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |