>Is it possible to set the data environment in a form (or report) so that if it is run in production, it accesses the dbc on production server but if it is run in development, it access the dbc on development box?
>
>In this particular case, dbc and all dbf names are identical. The only difference is the path to the dbc. I have tried to do this, but for some reason the data environment remembers that it got itself from development path and I can't seem to be able to re-direct it. I'm probably not doing something really simple right, but it has me stumped!
>
>Appreciate any help. - Susan
Susan,
There is a chapter in the Effective Techniques book that builds a from class that can do what you want.
Basically, what you need to do is in the form's Load make sure that the tables are closed by calling the ThisForm.DataEnvironment.CloseTables(). Then you can get a list of the DE's members with AMEMBERS(). You then loop through the members and for the Cursor baseclass you set the Database property to point where you want. Finally, you call the DE's OpenTables() method.