dave_s1
10-23-02, 04:40
| Dear All! How do we change/switch database that a form's data-environment refers to at runtime? For example, at design time, MyForms's data-environment consists of TableA which belongs to C:\MyDatabase.dbc but at run-time we want to switch to D:\MyDatabase.dbc which also contains table with same name (TableA). Whatever the solution is, I prefer it to be on MyFormBaseClass and not inside any of data-environments' methods so form(s) I created will automatically inherit same characteristic. Also, I don't want to open table(s) manually such as "open database D:\MyDatabase ... use TableA" For experiment purposes I've tried to put these commands in Suppliers.scx's Load method (Tastrade sample app) : this.dataenvironment.closetables this.dataenvironment.objects[1].database='D:\tastrade.dbc' this.dataenvironment.opentables but it generated an error. Thank you in advance. David |