Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data environment
Message
 
 
To
10/09/1999 08:17:11
Bill Tetrault
Northern Trust Value Investors
West Palm Beach, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00263304
Message ID:
00263329
Views:
23
>I've developed an application on a network, I do my development work
>on "p:\development\" and data stor in a subdir of that called
>data, problem I'm having is when I compile
>and install the app for a user with the same structure yet different
>drive say "g:\" with a data subdir the app runs yet prompts
>the users for location of the database.

Hi Bill.

You need to put some code into your forms so that they point to your live data directory. I do the following

--------------
VFP forms store the path to the tables used in the dataenvironment. Unfortunately when you deploy an application, your forms may point back to your development directory. These paths should be reset at runtime to ensure they are pointing to the proper tables.

* in your main startup PRG determine the current directory
* store in global vars or application object
gcAppPath = sys(2003)
gcDBPath = alltrim(gcAppPath)+"\data\"
gcDBName = "mydatabase.dbc"

*modify your form base class to contain the following in the load method (or change each form).
*also modify your form dataenvironment so make AutoOpenTables=.F.

* point all the tables to the right directory
thisform.SetAll("Database",gcDbPath+gcDbname,"Cursor")
* open the tables
thisform.dataenvironment.opentables()

*NOTE: the above works with tables in a database, the code should be modified if you use free tables.
---------------
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform