>I have a VFP9 form with a data environment that I add a few tables to. The form works great. My only problem is that when I run the production app on my dev pc, the form always opens up the development tables in it's data environment and not the production tables.
>
>The data always reside in a directory separate from the app. My app always SET PATH TO the data directory so the tables can be found. But since I have rights to the dev drive, my production app always opens the development tables. I assume that's because of the data environment.
>
>All other users that don't have access to the development drive always open the production tables when they run the app. This is the behaviour I am looking for.
>
>I assume that the data environment searches for the tables as defined in the DE then searches the PATH() for the tables.
>
>Is there a way to remove the path from the data environment? I only want my app to find the tables via the SET PATH statement.
>
>Thanks,
>
>Jerry
I've gotten around this by running a routine that USEs each SCX file in my development directory, scanning throught it for upper(BaseClass)="CURSOR" and looking for the "Database =" line in the Properties memo field. Then I'd remove any pathing found in that line.
Something like this (I don't have specific code for the properties manipulation part because my data is always stored in a DATA directory directly underneath my development directory so I just do a REPLACE Properties with STRTRAN(Properties,"data\",""), but the comments below will give you an idea as to how to handle it generally... you might also want to check/fix any "CursorSource =" lines also for free tables that don't have a "Database =" line in their properties.
for xx=1 to adir(laFiles,"*.SCX")
use (laFiles[xx,1]) exclusive alias myform
scan for alltrim(upper(BaseClass))="CURSOR"
endscan
use
compile form (laFiles[xx,1])
endfor
--Brad