>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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement