Board index » delphi » ModifyAlias question

ModifyAlias question

I have a need to be able to switch between multiple years worth of data in
my app.  I have used the ModifyAlias proc to change the path that all of my
current TTable and TQuery Alias points to.  When I look at the BDEAdmin, the
path is, indeed, being changed but the data itself is not switching - why?
Do you have to refresh all the datasets or something?

Jeff

 

Re:ModifyAlias question


Quote
Jeff Swanberg wrote:
> I have a need to be able to switch between multiple years worth of data in
> my app.  I have used the ModifyAlias proc to change the path that all of my
> current TTable and TQuery Alias points to.  When I look at the BDEAdmin, the
> path is, indeed, being changed but the data itself is not switching - why?
> Do you have to refresh all the datasets or something?

> Jeff

First: you need to call TSession.SaveConfigFile.  And also: if dont
SaveConfigFile, then if you're using more than one session, the change is
visible only to those sessions with cfmPersistent included in the ConfigMode
property.

Victor H. Ulloa
Tierra Fertil S.A.

Re:ModifyAlias question


I did call Session.SaveConfigFile (until then the BDEAdmin wasn't even
reporting the change).  Still, though, when I run a report or query, etc.
after altering the Alias path, the result set is still from the data on the
original path.

Jeff

Tierra Fertil S.A. <tfer...@hotmail.com> wrote in message
news:36CCC64A.96ADFC97@hotmail.com...

Quote

>Jeff Swanberg wrote:

>> I have a need to be able to switch between multiple years worth of data
in
>> my app.  I have used the ModifyAlias proc to change the path that all of
my
>> current TTable and TQuery Alias points to.  When I look at the BDEAdmin,
the
>> path is, indeed, being changed but the data itself is not switching -
why?
>> Do you have to refresh all the datasets or something?

>> Jeff

>First: you need to call TSession.SaveConfigFile.  And also: if dont
>SaveConfigFile, then if you're using more than one session, the change is
>visible only to those sessions with cfmPersistent included in the
ConfigMode
>property.

>Victor H. Ulloa
>Tierra Fertil S.A.

Re:ModifyAlias question


Brian,

OK, but can you give me a quick 1-2-3 on how to do this?  I checked the
online help and my D4 books but they didn't give much specific instruction.
I have a D4 app with local Pdox tables.  My app has about 50 forms each with
multiple Infopower Table and Query components.

1.  Where do I place the Tdatabase component and how do I configure it?
2.  How do I link all of my existing Infopower components to it instead of
using the Alias?
3.  Then, how do I change the data path for the database component so that
all of the internal components reflects that change immediately?

Jeff

Brian Bushay TeamB <BBus...@Nmpls.com> wrote in message
news:36d4ed9d.45294733@floyd...

Quote
>>I have a need to be able to switch between multiple years worth of data in
>>my app.  I have used the ModifyAlias proc to change the path that all of
my
>>current TTable and TQuery Alias points to.  When I look at the BDEAdmin,
the
>>path is, indeed, being changed but the data itself is not switching - why?

>You need to close all the table connected to the alias and then reopen
them.
>However I recommend you use a Tdatabase component instead of an Alias it is
>easier to modify its Path parameter and connect it to another path.

>--
>Brian Bushay (TeamB)
>Bbus...@NMPLS.com

Re:ModifyAlias question


Brian,

OK, but can you give me a quick 1-2-3 on how to do this?  I checked the
online help and my D4 books but they didn't give much specific instruction.
I have a D4 app with local Pdox tables.  My app has about 50 forms each with
multiple Infopower Table and Query components.

1.  Where do I place the Tdatabase component and how do I configure it?
2.  How do I link all of my existing Infopower components to it instead of
using the Alias?
3.  Then, how do I change the data path for the database component so that
all of the internal components reflects that change immediately?

Jeff

Brian Bushay TeamB <BBus...@Nmpls.com> wrote in message
news:36d4ed9d.45294733@floyd...

Quote
>>I have a need to be able to switch between multiple years worth of data in
>>my app.  I have used the ModifyAlias proc to change the path that all of
my
>>current TTable and TQuery Alias points to.  When I look at the BDEAdmin,
the
>>path is, indeed, being changed but the data itself is not switching - why?

>You need to close all the table connected to the alias and then reopen
them.
>However I recommend you use a Tdatabase component instead of an Alias it is
>easier to modify its Path parameter and connect it to another path.

>--
>Brian Bushay (TeamB)
>Bbus...@NMPLS.com

Re:ModifyAlias question


Brian,

I also tried the suggestion of closing then reopening the Table components
connected to the Alias whose path I changed.  It still does not change the
Alias path to pick up the tables in the new path even though the BDEAdmin
shows that the IDAPI32.CFG file nows holds the newly changed path.

Jeff

Brian Bushay TeamB <BBus...@Nmpls.com> wrote in message
news:36d4ed9d.45294733@floyd...

Quote
>>I have a need to be able to switch between multiple years worth of data in
>>my app.  I have used the ModifyAlias proc to change the path that all of
my
>>current TTable and TQuery Alias points to.  When I look at the BDEAdmin,
the
>>path is, indeed, being changed but the data itself is not switching - why?

>You need to close all the table connected to the alias and then reopen
them.
>However I recommend you use a Tdatabase component instead of an Alias it is
>easier to modify its Path parameter and connect it to another path.

>--
>Brian Bushay (TeamB)
>Bbus...@NMPLS.com

Re:ModifyAlias question


Quote
>I have a need to be able to switch between multiple years worth of data in
>my app.  I have used the ModifyAlias proc to change the path that all of my
>current TTable and TQuery Alias points to.  When I look at the BDEAdmin, the
>path is, indeed, being changed but the data itself is not switching - why?

You need to close all the table connected to the alias and then reopen them.
However I recommend you use a Tdatabase component instead of an Alias it is
easier to modify its Path parameter and connect it to another path.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:ModifyAlias question


Quote

>OK, but can you give me a quick 1-2-3 on how to do this?  I checked the
>online help and my D4 books but they didn't give much specific instruction.
>I have a D4 app with local Pdox tables.  My app has about 50 forms each with
>multiple Infopower Table and Query components.

>1.  Where do I place the Tdatabase component and how do I configure it?
>2.  How do I link all of my existing Infopower components to it instead of
>using the Alias?
>3.  Then, how do I change the data path for the database component so that
>all of the internal components reflects that change immediately?

Place the tdatabase component in your datamodle
double click on it
Enter a value in the name box.  You will use this name in the databaseName
property of all you tables just like you know use the alias name.
Leave the Alias box blank
Choose the appropriate driver (STANDARD for Paradox)
Next click the defaults button
You will see a path parameter there.  Set this to the directory of your tables.

At runtime to change directories set the Connected property to false.
change the path parameter
set the connected property to true
Then reset any tables Active property to true.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads