 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jeff Douglass Guest
|
Posted: Tue Oct 21, 2003 11:46 pm Post subject: Name not unique in this contex error? |
|
|
In BCB 5 pro app that uses a paradox database file for storing application
events I am getting a "Name not unique in this contex" whenever I start the
app and I try to do the initalization stuff for this log file. This only
happens if my other BCB 5 pro app that acts as a database viewer/report
generator is running and has the same database file open. Any ideas what
could be the problem?
Thanks
Jeff
|
|
| Back to top |
|
 |
Jeff Douglass Guest
|
Posted: Wed Oct 22, 2003 2:44 am Post subject: Re: Name not unique in this contex error? |
|
|
More info. The error is happening at a call to session->AddStandardAlias().
Thanks
--
Jeff Douglass
President
Integrated Software Technologies Inc.
This e-mail message contains confidential, privileged information intended
solely for the addressee. Please do not read, copy, or disseminate it unless
you are the addressee. If you have received it in error, please call us at
(480) 704-5066 and ask to speak with the message sender. Also, we would
appreciate your forwarding the message back to us and deleting it from your
system. Thank you.
To learn more about our firm, please visit our website at
http://www.istisw.com.
"Jeff Douglass" <.> wrote
| Quote: | In BCB 5 pro app that uses a paradox database file for storing application
events I am getting a "Name not unique in this contex" whenever I start
the
app and I try to do the initalization stuff for this log file. This only
happens if my other BCB 5 pro app that acts as a database viewer/report
generator is running and has the same database file open. Any ideas what
could be the problem?
Thanks
Jeff
|
|
|
| Back to top |
|
 |
Jayme Jeffman Filho Guest
|
Posted: Wed Oct 22, 2003 12:57 pm Post subject: Re: Name not unique in this contex error? |
|
|
Hi Jeff,
You may have been trying to add an existent alias to the opened Session.
This method shoud be used for create new database aliases, not to put them
in use. You should check if the alias name exists before call the
AddStandardAlias method.
From the Help file :
"Description
Call AddStandardAlias at runtime to create a session-specific BDE alias for
Paradox, dBASE or ASCII tables...."
HTH
Jayme.
"Jeff Douglass" <.> escreveu na mensagem
news:3f95ef7d$2 (AT) newsgroups (DOT) borland.com...
| Quote: | More info. The error is happening at a call to
session->AddStandardAlias().
Thanks
--
Jeff Douglass
President
Integrated Software Technologies Inc.
This e-mail message contains confidential, privileged information intended
solely for the addressee. Please do not read, copy, or disseminate it
unless
you are the addressee. If you have received it in error, please call us at
(480) 704-5066 and ask to speak with the message sender. Also, we would
appreciate your forwarding the message back to us and deleting it from
your
system. Thank you.
To learn more about our firm, please visit our website at
http://www.istisw.com.
"Jeff Douglass" <.> wrote
In BCB 5 pro app that uses a paradox database file for storing
application
events I am getting a "Name not unique in this contex" whenever I start
the
app and I try to do the initalization stuff for this log file. This only
happens if my other BCB 5 pro app that acts as a database viewer/report
generator is running and has the same database file open. Any ideas what
could be the problem?
Thanks
Jeff
|
|
|
| Back to top |
|
 |
Jeff Douglass Guest
|
Posted: Wed Oct 22, 2003 3:09 pm Post subject: Re: Name not unique in this contex error? |
|
|
Yes, I am using the call to create a temp alias for the session for what I
thought was only for the life of the app. However, what I found out was that
the app run fine if the other app that uses the BDE is not running. However,
if the other app is running, then the main app that is having the problem
will start up and run fine the first time but will fail in subsequent starts
untill I shutdow the other app.
From what I can figure out, I was getting the problem because when another
program that also uses the BDE was running, adding the alias in my app and
not deleting it the alias remained in the BDE memory so when I tried to run
the program again and tried to create the same alias, the alias was still in
the BDE memory eventhough the app that created the alias had terminated. I
fixed the problem by calling the DeleteAlias() function in the classes
destructor that handles the dbase stuff. Does this logic make sence to you?
Is there a better way to do this?
Thanks again.
Jeff
|
|
| Back to top |
|
 |
Jayme Jeffman Filho Guest
|
Posted: Wed Oct 22, 2003 4:51 pm Post subject: Re: Name not unique in this contex error? |
|
|
Hi Jeff,
As the BDE aliases belongs to a single workstation you can delete them when
the application which has created it has finished, although you might have
another application running on the same machine that is using the same BDE
alias too.
Why don't you check if the BDE alias exist, if so connect to it, else create
the alias ?
You can also do not create any alias to configure your application, the
applications I've made using Paradox do not use any BDE alias, I just setup
the TDatabase::Directory.
HTH
Jayme.
"Jeff Douglass" <.> wrote
| Quote: | Yes, I am using the call to create a temp alias for the session for what I
thought was only for the life of the app. However, what I found out was
that
the app run fine if the other app that uses the BDE is not running.
However,
if the other app is running, then the main app that is having the problem
will start up and run fine the first time but will fail in subsequent
starts
untill I shutdow the other app.
From what I can figure out, I was getting the problem because when another
program that also uses the BDE was running, adding the alias in my app and
not deleting it the alias remained in the BDE memory so when I tried to
run
the program again and tried to create the same alias, the alias was still
in
the BDE memory eventhough the app that created the alias had terminated. I
fixed the problem by calling the DeleteAlias() function in the classes
destructor that handles the dbase stuff. Does this logic make sence to
you?
Is there a better way to do this?
Thanks again.
Jeff
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|