>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only