I have developed an application. Now I want to add a "Training" feature that will will the same tables as the "real" application. I have a new database for the training, but all the forms have the database as the original. How can I tell each form that the database has changed from MyData to MyDataTr so that the tables in the training folder can be used with the forms that were created using the original database of MyData? In other words, is there a way to programatically change the database property within each form?

Re: Databases by Gerben

Gerben
Fri Jun 25 15:55:59 CDT 2004

Hi Cowboy,

If you open one of your databases in per example your main progam, and you
do not use the dataenvironement of the form, you have a solution for your
problem.
Or an other solution, you can use cursoradaptors which can be used in de
DataEnvironement, and switch them to the right database, but that is a
little more complicated.

HTH,
Gerben Kessen



"Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
news:ADE5B9F2-05D7-4B30-B976-0F742B0340CE@microsoft.com...
> I have developed an application. Now I want to add a "Training" feature
that will will the same tables as the "real" application. I have a new
database for the training, but all the forms have the database as the
original. How can I tell each form that the database has changed from
MyData to MyDataTr so that the tables in the training folder can be used
with the forms that were created using the original database of MyData? In
other words, is there a way to programatically change the database property
within each form?



Re: Databases by John

John
Fri Jun 25 16:32:19 CDT 2004

I have found the easiest way is to create a duplicate database in a
"training" folder. Have your app set the path to the training folder. That
way you do not have to change anything in your form. And you will be
assured that your real data is always protected.

Main app...
...
do case
case not llTrainingApp
set path to c:\myapp\data\ &&path to tables/databases/cdxs
case llTrainingApp
set path to c:\mytrainingapp\data && path to training database
endcase
do form MyApp
read events
...

Do not hard code paths in the DE of the form nor anywhere in your app except
at the main level.
John


"Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
news:ADE5B9F2-05D7-4B30-B976-0F742B0340CE@microsoft.com...
> I have developed an application. Now I want to add a "Training" feature
that will will the same tables as the "real" application. I have a new
database for the training, but all the forms have the database as the
original. How can I tell each form that the database has changed from
MyData to MyDataTr so that the tables in the training folder can be used
with the forms that were created using the original database of MyData? In
other words, is there a way to programatically change the database property
within each form?



Re: Databases by Cowboy

Cowboy
Fri Jun 25 23:23:01 CDT 2004

Does that mean I can ignore the "database" property of the environment? Currently in the form, the form's environment says "\MyApp\Data" when in fact, I will be setting the default to "c:\MyTrainingApp\Data ?

TIA

"John G." wrote:

> I have found the easiest way is to create a duplicate database in a
> "training" folder. Have your app set the path to the training folder. That
> way you do not have to change anything in your form. And you will be
> assured that your real data is always protected.
>
> Main app...
> ....
> do case
> case not llTrainingApp
> set path to c:\myapp\data\ &&path to tables/databases/cdxs
> case llTrainingApp
> set path to c:\mytrainingapp\data && path to training database
> endcase
> do form MyApp
> read events
> ....
>
> Do not hard code paths in the DE of the form nor anywhere in your app except
> at the main level.
> John
>
>
> "Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
> news:ADE5B9F2-05D7-4B30-B976-0F742B0340CE@microsoft.com...
> > I have developed an application. Now I want to add a "Training" feature
> that will will the same tables as the "real" application. I have a new
> database for the training, but all the forms have the database as the
> original. How can I tell each form that the database has changed from
> MyData to MyDataTr so that the tables in the training folder can be used
> with the forms that were created using the original database of MyData? In
> other words, is there a way to programatically change the database property
> within each form?
>
>
>

Re: Databases by Anders

Anders
Sat Jun 26 04:51:28 CDT 2004

The path shown in he form's DE is the evaluation of the default path + the
relative path stored in the database. Try SET DEFULT TO ..\trainingdata
before starting up the form.
-Anders

"Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
news:89AC08AA-5403-4867-9492-124DE8548E01@microsoft.com...
> Does that mean I can ignore the "database" property of the environment?
Currently in the form, the form's environment says "\MyApp\Data" when in
fact, I will be setting the default to "c:\MyTrainingApp\Data ?
>
> TIA
>
> "John G." wrote:
>
> > I have found the easiest way is to create a duplicate database in a
> > "training" folder. Have your app set the path to the training folder.
That
> > way you do not have to change anything in your form. And you will be
> > assured that your real data is always protected.
> >
> > Main app...
> > ....
> > do case
> > case not llTrainingApp
> > set path to c:\myapp\data\ &&path to tables/databases/cdxs
> > case llTrainingApp
> > set path to c:\mytrainingapp\data && path to training database
> > endcase
> > do form MyApp
> > read events
> > ....
> >
> > Do not hard code paths in the DE of the form nor anywhere in your app
except
> > at the main level.
> > John
> >
> >
> > "Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
> > news:ADE5B9F2-05D7-4B30-B976-0F742B0340CE@microsoft.com...
> > > I have developed an application. Now I want to add a "Training"
feature
> > that will will the same tables as the "real" application. I have a new
> > database for the training, but all the forms have the database as the
> > original. How can I tell each form that the database has changed from
> > MyData to MyDataTr so that the tables in the training folder can be used
> > with the forms that were created using the original database of MyData?
In
> > other words, is there a way to programatically change the database
property
> > within each form?
> >
> >
> >


Re: Databases by Cowboy

Cowboy
Sun Jun 27 11:25:01 CDT 2004

I cannot get this to work. THe form continues to display the original data and not the data referenced by the set default stmt.

"Anders Altberg" wrote:

> The path shown in he form's DE is the evaluation of the default path + the
> relative path stored in the database. Try SET DEFULT TO ..\trainingdata
> before starting up the form.
> -Anders
>
> "Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
> news:89AC08AA-5403-4867-9492-124DE8548E01@microsoft.com...
> > Does that mean I can ignore the "database" property of the environment?
> Currently in the form, the form's environment says "\MyApp\Data" when in
> fact, I will be setting the default to "c:\MyTrainingApp\Data ?
> >
> > TIA
> >
> > "John G." wrote:
> >
> > > I have found the easiest way is to create a duplicate database in a
> > > "training" folder. Have your app set the path to the training folder.
> That
> > > way you do not have to change anything in your form. And you will be
> > > assured that your real data is always protected.
> > >
> > > Main app...
> > > ....
> > > do case
> > > case not llTrainingApp
> > > set path to c:\myapp\data\ &&path to tables/databases/cdxs
> > > case llTrainingApp
> > > set path to c:\mytrainingapp\data && path to training database
> > > endcase
> > > do form MyApp
> > > read events
> > > ....
> > >
> > > Do not hard code paths in the DE of the form nor anywhere in your app
> except
> > > at the main level.
> > > John
> > >
> > >
> > > "Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
> > > news:ADE5B9F2-05D7-4B30-B976-0F742B0340CE@microsoft.com...
> > > > I have developed an application. Now I want to add a "Training"
> feature
> > > that will will the same tables as the "real" application. I have a new
> > > database for the training, but all the forms have the database as the
> > > original. How can I tell each form that the database has changed from
> > > MyData to MyDataTr so that the tables in the training folder can be used
> > > with the forms that were created using the original database of MyData?
> In
> > > other words, is there a way to programatically change the database
> property
> > > within each form?
> > >
> > >
> > >
>
>

Re: Databases by Anders

Anders
Sun Jun 27 19:20:23 CDT 2004

Is Fred's assumption correct?
-Anders

"Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
news:77A59F79-09EC-47A9-957F-73A41206E5C4@microsoft.com...
> I cannot get this to work. THe form continues to display the original
data and not the data referenced by the set default stmt.
>
> "Anders Altberg" wrote:
>
> > The path shown in he form's DE is the evaluation of the default path +
the
> > relative path stored in the database. Try SET DEFULT TO ..\trainingdata
> > before starting up the form.
> > -Anders
> >
> > "Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
> > news:89AC08AA-5403-4867-9492-124DE8548E01@microsoft.com...
> > > Does that mean I can ignore the "database" property of the
environment?
> > Currently in the form, the form's environment says "\MyApp\Data" when in
> > fact, I will be setting the default to "c:\MyTrainingApp\Data ?
> > >
> > > TIA
> > >
> > > "John G." wrote:
> > >
> > > > I have found the easiest way is to create a duplicate database in a
> > > > "training" folder. Have your app set the path to the training
folder.
> > That
> > > > way you do not have to change anything in your form. And you will
be
> > > > assured that your real data is always protected.
> > > >
> > > > Main app...
> > > > ....
> > > > do case
> > > > case not llTrainingApp
> > > > set path to c:\myapp\data\ &&path to tables/databases/cdxs
> > > > case llTrainingApp
> > > > set path to c:\mytrainingapp\data && path to training
database
> > > > endcase
> > > > do form MyApp
> > > > read events
> > > > ....
> > > >
> > > > Do not hard code paths in the DE of the form nor anywhere in your
app
> > except
> > > > at the main level.
> > > > John
> > > >
> > > >
> > > > "Cowboy" <Cowboy@discussions.microsoft.com> wrote in message
> > > > news:ADE5B9F2-05D7-4B30-B976-0F742B0340CE@microsoft.com...
> > > > > I have developed an application. Now I want to add a "Training"
> > feature
> > > > that will will the same tables as the "real" application. I have a
new
> > > > database for the training, but all the forms have the database as
the
> > > > original. How can I tell each form that the database has changed
from
> > > > MyData to MyDataTr so that the tables in the training folder can be
used
> > > > with the forms that were created using the original database of
MyData?
> > In
> > > > other words, is there a way to programatically change the database
> > property
> > > > within each form?
> > > >
> > > >
> > > >
> >
> >