Session.FindDatabase finding deleted alias 
Author Message
 Session.FindDatabase finding deleted alias

Hi everyone,

I've just come across something which I find very puzzling.  I'm working on
a single-tier database application, using delphi 4 and Paradox, and using
the default Session.

At runtime, I delete a BDE alias, by using:

    Session.DeleteAlias('myAlias');
    Session.SaveConfigFile;

If I open Database Desktop and go into the Alias Manager, 'myAlias' is no
longer there, as I would expect.  If I close the application, and then open
it again, the Session can't find 'myAlias', also as I would expect.

However, if I _don't_ close the application after running the above code,
Session.FindDatabase('myAlias') returns the database, and I can still open
it by setting a TTable's database to 'myAlias', but Session.GetAliasNames
doesn't find it!

Can anyone shed any light?

Thanks,

Ruth



Tue, 04 Nov 2003 19:28:59 GMT  
 Session.FindDatabase finding deleted alias
That is normal behaviour. You can only see modifications to the BDE
configuration if you close and reopen the session.



Quote:
> Hi everyone,

> I've just come across something which I find very puzzling.  I'm working
on
> a single-tier database application, using Delphi 4 and Paradox, and using
> the default Session.

> At runtime, I delete a BDE alias, by using:

>     Session.DeleteAlias('myAlias');
>     Session.SaveConfigFile;

> If I open Database Desktop and go into the Alias Manager, 'myAlias' is no
> longer there, as I would expect.  If I close the application, and then
open
> it again, the Session can't find 'myAlias', also as I would expect.

> However, if I _don't_ close the application after running the above code,
> Session.FindDatabase('myAlias') returns the database, and I can still open
> it by setting a TTable's database to 'myAlias', but Session.GetAliasNames
> doesn't find it!

> Can anyone shed any light?

> Thanks,

> Ruth



Tue, 04 Nov 2003 20:19:56 GMT  
 Session.FindDatabase finding deleted alias
Thanks.

Have you any idea why Session.GetAliasNames doesn't find the deleted alias
when Session.FindDatabase does?

Ruth


Quote:
> That is normal behaviour. You can only see modifications to the BDE
> configuration if you close and reopen the session.



> > Hi everyone,

> > I've just come across something which I find very puzzling.  I'm working
> on
> > a single-tier database application, using Delphi 4 and Paradox, and
using
> > the default Session.

> > At runtime, I delete a BDE alias, by using:

> >     Session.DeleteAlias('myAlias');
> >     Session.SaveConfigFile;

> > If I open Database Desktop and go into the Alias Manager, 'myAlias' is
no
> > longer there, as I would expect.  If I close the application, and then
> open
> > it again, the Session can't find 'myAlias', also as I would expect.

> > However, if I _don't_ close the application after running the above
code,
> > Session.FindDatabase('myAlias') returns the database, and I can still
open
> > it by setting a TTable's database to 'myAlias', but

Session.GetAliasNames

- Show quoted text -

Quote:
> > doesn't find it!

> > Can anyone shed any light?

> > Thanks,

> > Ruth



Tue, 04 Nov 2003 21:02:01 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to delete an ODBC alias

2. Deleting or Changing an Alias

3. Deleting a BDE-Alias from Application

4. Delete alias in 16-bit BDE

5. DELETE a BDE alias--Get code Here!

6. Help me ! Delete Alias (Delphi 1)

7. Deleting an Alias from the BDE in D1

8. How edit and delete alias in Delphi1?

9. deleting an alias from BDE at runtime

10. BDE: Add/Delete Alias

11. Modify or delete alias in code (D1)

12. Delete Alias in code

 

 
Powered by phpBB® Forum Software