Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing path from Data Environment
Message
 
To
11/05/2005 13:35:12
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01013036
Message ID:
01013115
Views:
16
>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"
    *Use ALINES() to get Properties memo data into an array
    *and parse through it looking for the "Database =" line and
    *do a JUSTFNAME() on everything after the equals sign
    *and update the Properties memo field with the revised info
  endscan
  use
  compile form (laFiles[xx,1])
endfor
--Brad
Previous
Reply
Map
View

Click here to load this message in the networking platform