General information
Category:
Forms & Form designer
Erik:
The DataEnvironment object does not have a SetAll method. I don't understand why VFP does not consider it as a container (with a objects collection)...
Rajesh:
Try something like this:
*----------------------------------------------
*-- Dataenvironement - BeforeOpenTables method
*----------------------------------------------
=THISFORM.SetDEProp(THIS)
*---------------------
*-- SetDEProp method
*-- -----------------
LPARAMETERS toDE
LOCAL lnCounter && Loop counter.
LOCAL lcDatabase && The current Atlas database.
LOCAL lcName && The name of the oontained object.
LOCAL loObject && The object under consideration.
LOCAL lnObjectCount && Number of objects in the DE.
LOCAL laObjects[1] && Contains a reference to each object in the DE
lcDatabase = goapp.Database
IF (TYPE("toDE") == "O") AND NOT ISNULL(toDE)
IF LOWER(toDE.BaseClass) == "dataenvironment"
lnObjectCount = AMEMBERS(laObjects, toDE, 2)
FOR m.lnCounter = 1 TO m.lnObjectCount
lcName = laObjects[m.lnCounter]
loObject = toDE.&lcName.
IF LOWER(loObject.BaseClass) == "cursor"
loObject.Database = m.lcDatabase
ENDIF
ENDFOR
ENDIF
ENDIF
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only