Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change database dynamically
Message
De
16/06/2000 10:15:12
 
 
À
16/06/2000 09:22:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00381252
Message ID:
00381358
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform