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:
00314751
Views:
25
Nick,

I'm not sure, that I understand, how can we take it of from the loop. It evaluates loObj depending on laCursorList[i]...

TIA

>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....
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform