Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data environment
Message
De
15/09/1999 07:22:15
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00263304
Message ID:
00264849
Vues:
22
>>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.
>---------------

Evan,

use set path command to establish the default path.

Clear the database property:

thisform.SetAll("Database", '',"Cursor")

In this case, foxpro itself searches set path directories to find database.
Andrus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform