Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataEnvironment using hard-coded database path
Message
De
13/12/2001 22:56:27
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
DataEnvironment using hard-coded database path
Divers
Thread ID:
00594235
Message ID:
00594235
Vues:
59
My VFP 6 app uses containers and dbfs, no remote data sources. In my ini, I can point to different directories for dev, testing or production. My app reads the ini, determines where to point and then opens the requested database.

PROBLEM

In any form's data environment, the cursor seems to be mapped to the DEVELOPMENT dbc. So, even though I OPEN DATA N:\MYAPP\DATA\MYDBC.dbc early on in the app, all forms seem to open cursors off my development dbc (C:\MYAPP\DATA\MYDBC.dbc).

A workaround I found was to change the DataEnvironment.Cursor?.Database in the form's DE BeforeOpenTables event:

This.Cursor1.Database = goapp.cPathNet + [Data\MyApp.dbc]

But this seems rather painful. You have to do it for EVERY table that is opened in EVERY DE. There is no DE inheritance so I cannot put it in my base form class (I hear 7.0 does this). And there is no SetAll() type method to apply such a change to ALL cursors of a DE.

This being such a classic situation (development, testing, production paths), there MUST be an obvious way that I'm missing.

Thanks

Henry
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform