Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cycle though tables in DataEnviornment
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00314653
Message ID:
00314654
Views:
26
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....

(On an infant's shirt): Already smarter than Bush
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform