Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataEnvironment using hard-coded database path
Message
From
13/12/2001 22:56:27
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
DataEnvironment using hard-coded database path
Miscellaneous
Thread ID:
00594235
Message ID:
00594235
Views:
56
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
Next
Reply
Map
View

Click here to load this message in the networking platform