Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using a different database depending upon user
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00125834
Message ID:
00126360
Views:
21
Jamie,

Try this:
amembers(acursors, thisform.dataenvironment, 2)

 for i = 1 to ALEN(acursors,1)
    oDataEnv = EVAL("thisform.dataenvironment." + acursors[i])
    if oDataEnv.baseclass = "Cursor"    
       **  This keeps you from changing relations
       oDataEnv.cursorsource = cpathvar + oDataEnv.cursorsource 
    endif
 endfor
HTH
Barbara

>Barbara,
>Thanks, this works fine but....To take it a little further, is there a way to find the number of cursors contained in a form's dataenvironment by way of an array or some type of function? This way I could set up a loop through the array and change the path without hardcoding all the seperate statements.
>Thanks again,
>Jamie
>
>>You can put code into the DataEnvironment BeforeOpenTables event which re-sets the path. There have been several recent threads about this, and since you're PUTM, I suggest a search for ALL the info instead of a quick re-hash. You can add this code to your base form, and not have to update every form.
>>
>>HTH
>>Barbara
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform