Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test/Production DataEnvironments
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00047621
Message ID:
00048001
Views:
50
>The scenario:
>I have a simple form that uses the DataEnvironment for the tables. I create an .EXE and put it into a production directory that has it's own matching .DBC and tables. But the .EXE always refers back to the development directory's tables. I've done this before, but can't possibly understand how!

Hi Darren

First you need to get the directory where the program start and the database relative to this drive such as you start on F: drive and your database in F:\yourdata\dbf etc...., Create a variable cDatabaseDirectory and assign the the database drive+your data base name to it such as cDatabaseDirectory=(F:\yourdata\dbf\+yourdatbasename) you can use SYS(16) and other function to get where you start it.

Now you have a variable " cDatabaseDirectory" that point to your database.

In the BeforeOpenTables method in the dataenvironment set the cursor database to the "cDatabaseDirectory"

this.Cursor1.database = cDatabaseDirectory

You can create a method that goes over all cursor in the database and set their database to "cDatabaseDirectory"

Have fun
Previous
Reply
Map
View

Click here to load this message in the networking platform