Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DBC name tied to the DE
Message
From
20/02/1998 14:10:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00080159
Message ID:
00080169
Views:
24
>Our application needs to switch DBCs for different data sets. The
>structure for each is the same but the data is different. Our form Data Environment is tied to the name of the DBC. I have tried setting the name of the desired DBC in the DE method - before tables are opened, but to no avail. (I used set database to ...)
>
>What is the best way to overcome this? I could ask the DE not to open/close the tables and open them explicitly, but would prefer to let the DE do its work if there is a simpler approach. It would be preferable if I could set the database once at the beginning of the application.
>
>Thanks much,
>Nancy
Hi Nancy,
This one is from thread #67659, Title-"Question abt. dataenvironment"
* Dataenvironment.beforeopentables
cNewDataPath = _screen.comment && or wherever stored
set path to (cNewDataPath)
nDataObjects = amembers(aMyArray,this,2)
cOldPath = this.&aMyArray[1]..database
cNewDbPath = cNewDataPath+substr(cOldPath,rat("\",cOldPath))
for ix = 1 to nDataObjects
 if this.&aMyArray[ix]..baseclass = "Cursor"
 this.&aMyArray[ix]..database = cNewDbPath
 endif
endfor

Here is a way to change path at runtime using above :

*Method processing user data path && Likely to be called instead of do form
lparameters cNewDataPath, fForm
_screen.comment=cNewDataPath && Instead of pub var - if !used to store something else like form instances
do form (fForm)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform