Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tip on how to fix database path in Dataenvironment
Message
 
 
À
03/07/1997 11:51:23
Gino Miceli
Lan Professionals, Inc.
Bay Shore, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00038538
Message ID:
00038571
Vues:
40
>Many of you had been concerned with the Database property which is read-only at design time... the end result of this is that people with two copies of their dataset (one for development and one for production), even across a network, will have the app look at the original development copy of the dataset..bad indeed!
>
>The best solution I could come up with is the hardcode the following into the BeforeOpenTables() event of the DE of each form:
>
>this.Cursor1.Database = "..\Data\Main.dbc"
>this.Cursor2.Database = "..\Data\Main.dbc"
> ... etc.
>
>This seems to work very well, even if you move your distribution directory!
Using BeforeOpenTables event to reset all the cursor's Database property of the DE was a solution I've picked up from Edward (thanks again Edward!). To go maybe one step further, I don't "assume" even that my database will reside in the ..\Data\ subdirectory. To make it open as possible, I've put the path statement in the application's INI file to point to the path of the database. If and when the database needs to be move to another drive (network, local, etc.), subdirectory, whatever, I edit the path line of the INI file and that's it. This way, instead of hardcoding in the Database property, I get the path and filename from my oApp.Database property that is set at the beginning of the application.
It's "my" world. You're just living in it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform