Board index » delphi » Changing the alias for an application that uses the BDE

Changing the alias for an application that uses the BDE

I am having trouble changing the alias setting for an application that uses
several table and query components (Delphi 3).  The application keeps trying
to find the old alias even though, to the best of my knowledge, I have
removed all references to it in the application.

The alias I was using has worked fine for months but prior to preparing to
deploy the application using install shield, I decided to give the alias a
more meaningful name.  Accordingly I amended the Database Name property of
each table and query component on the form to the new alias and recompiled.
When the application was run it continued to look for the original alias
which had now been removed from the BDE.

Can anyone explain why this happens and offer a solution?

I have not added my own Database component to the main form since my needs
were simple and it appeared that table and query components would use an
implicit Database if one was not separately declared.  The alias for each
table and query component was therefore entered in their respective Database
Name properties.  I assumed that this was okay since the aliases available
on the BDE were in the drop down list for the Database Name property in the
IDE.

Any help gratefully appreciated.

Steve Walker

 

Re:Changing the alias for an application that uses the BDE


Quote
On Tue, 7 Sep 1999 12:58:38 +0100, "syberad" <sybe...@email.msn.com> wrote:
>I am having trouble changing the alias setting for an application that uses
>several table and query components (Delphi 3).  The application keeps trying
>to find the old alias even though, to the best of my knowledge, I have
>removed all references to it in the application.

[...]

BDE aliases are a convenience, but you do not *have* to use them. You can
opt to instead use a TDatabase component to locate and connect to the
database. Set up the connection using parameters specified in the Params
property of the TDatabase component. Other properties like DriverName,
DatabaseName, and LoginPrompt provide basic TDatabase attribute definition.

Use of a TDatabase instead of a BDE alias has the advantage that changing
the designated database is much simpler. You just disconnect the TDatabase,
change the connection parameters in the Params property, and then reconnect
the TDatabase.

Connecting to a database using a TDatabase component is described in the
Database Developer's Guide part of the Programmer's guide. In the Delphi
online help table of contents, navigate through the topic titles:

  Developing Database Applications
    Connecting to databases
      Controlling connections

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Health nuts are going to feel stupid someday,
Felton, CA                  lying in hospitals dying of nothing."
                                                              -- Redd Foxx

Re:Changing the alias for an application that uses the BDE


Steve,
I haven't had this exact problem, but have seen similar things. What's
worked for me:
1. use search all files from the Menus at the top of the screen to
search for the old alias. This will find all the .pas files, but won't
search in the .dfm files.
2. use Windows explorer or some other file search routine in the
operating system to search for the old alias. This will search through
the .dfm files, and the auxiliary files Delphi generates for each
project.
3. if the old alias is in one or more of the .dfm files, open the form
and find the object.
4. if the old alias is in one of the project files, try deleting that
file. [[backup the whole project first, of course]]
5. if you can't find it anywhere, try deleting the auxiliary project
files anyway. Delphi shouldn't have any trouble opening a project
given only the .dpr and all the unit files. [[remember: backup!!]

HTH,
Dan

On Tue, 7 Sep 1999 12:58:38 +0100, "syberad" <sybe...@email.msn.com>
wrote:

Quote
>I am having trouble changing the alias setting for an application that uses
>several table and query components (Delphi 3).  The application keeps trying
>to find the old alias even though, to the best of my knowledge, I have
>removed all references to it in the application.
> <snip>

--
Dan Brennand
CMDC systems, inc.
Configuration Management and Document Control: Consulting, Software,
and the only comprehesive textbook on this subject.
visit us at www.cmdcsystems.com
[Remove the SPAM from my e-mail address]

Other Threads