Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cycle though tables in DataEnviornment
Message
 
À
07/01/2000 14:08:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00314653
Message ID:
00314667
Vues:
25
Perry you may want to move this part

IF NOT DBUSED(loObj.Database)
OPEN DATABASE (loObj.Database)
ENDIF
SET DATABASE TO (loObj.Database)

outside the FOR... NEXT loop, so it is executed only once.


>Here's the code I use to cycle and correct the pointer to the DBC:
>
>*- Get Object members of Dataenvironment -*
>=AMEMBERS(laCursorList, Thisform.DataEnvironment, 2)
>IF EMPTY(laCursorList[1])
> RETURN
>ENDIF
>
>*- loop thru cursors and replace database name with correct database to use -*
> IF ALEN( laCursorList,1) > 0
> FOR I = 1 TO ALEN(laCursorList,1)
> loObj = EVAL("Thisform.DataEnvironment." + laCursorlist[i])
> IF UPPER(loObj.BASECLASS) = 'CURSOR' AND '\' $ loObj.Database
> IF NOT EMPTY(loObj.Database)
> *- table in database -*
> loObj.Database = oApp.gcDbPath + oApp.gcDbName
> IF NOT DBUSED(loObj.Database)
> OPEN DATABASE (loObj.Database)
> ENDIF
> SET DATABASE TO (loObj.Database)
> ELSE
> *- free table -*
> loObj.CursorSource = oApp.gcDbPath + oApp.gcDbName
> ENDIF
> ENDIF
> NEXT
>ENDIF
>
>>Is there a way to programaticily cycle though all the tables in the DataEnvironment of a form? Seems like there should be a way I can have a For-Next loop that just goes though all the cursors in the DE (I'll know how many of them are there)
>>
>>Thanks....
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform