Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change database dynamically
Message
From
16/06/2000 10:15:12
 
 
To
16/06/2000 09:22:41
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00381252
Message ID:
00381358
Views:
16
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
Map
View

Click here to load this message in the networking platform