TAliasEditor V01.02 - BDE alias management component for Delphi 2

Written by Glenn Davies (Glenn@home-pc.demon.co.uk).
Based on TDbiAlias (Delphi 1) by Richard Christman (christmn@cyberport.net).

******************************************************************************

Copyright notice:

This component is unrestricted freeware. It may be distributed, used and/or
modified without restriction. Please note that although this component has
been tested and been found to work correctly, you use it entirely at your
own risk and I will not be held responsible for corrupted IDAPI.CFG files,
damaged databases or alien invasions caused by using it.

******************************************************************************

Component Installation:

Copy AliasEd.pas and AliasEd.dcr to a suitable directory. Start Delphi 2
and select Component|Install from the menu. Click Add, then Browse, then
select AliasEd.pas in the open file dialog. Click OK to return to the
install component dialog and click OK again to install the component.

By default, the component appears on the Samples tab of the component
palette. This can be changed by editing the procedure Register in
AliasEd.pas and changing 'Samples' for the name of another tab.

If you don't like the component icon, then you can change that by
creating a replacement AliasEd.dcr using the Delphi Image Editor.
Full details are provided in the Delphi Component Writers Guide.

******************************************************************************

Example Application Installation:

As a result of numerous requests, I have included an example application which
demonstrates the use of TAliasEditor. The application is a (much)
cut down version of the BDE configuration utility.

After installing TAliasEditor as detailed above, copy EdTest.dpr, EdTest.res,
EdTest.dof, Main.pas and Main.dfm to a separate directory. Open EdTest.dpr
from Delphi 2 and press F9 to run the application.

******************************************************************************

Usage:

Simply place the Alias Editor component on a form as you would with
any other component.

******************************************************************************

Properties:

******************************************************************************

property Params: TStringList

  Run-time only. A ready-instantiated string list which may be used to hold the
parameter lists required by some of the methods.

******************************************************************************

property ConfigMode: TConfigMode

  Determines whether aliases accessible through Alias Editor are global
(cmPersistent), local (cmSession) or both (cmAll). See the Delphi on-line help
for TConfigMode for further information. The ConfigMode property affects only
the alias editor component - the ConfigMode property of Session is unaffected.
The default is cmPersistent.

******************************************************************************

Methods:

******************************************************************************

procedure Add(const alias, driver: String; the_params: TStrings);

  Adds a BDE alias. Driver is the default BDE driver to use for this alias
(eg. 'PARADOX' or 'INTRBASE'). If driver is a null string, then the alias will
have no DEFAULT DRIVER parameter (this is not strictly necessary for Paradox
and DBase tables anyway).

  The_params is a string list containing a list of parameters in the
following format:

  <Parameter name>=<Value>

  For example:

  PATH=C:\MyDirectory

  The Params property of the component may be used to hold the parameter
list if you wish, or you may use any TStrings or TStringList. The easiest way
to set up parameters in this format is to use the Values property.

  Example:

  AliasEditor.Params.Values['PATH'] := 'C:\MyDirectory';
  AliasEditor.Add('MyAlias','PARADOX',AliasEditor.Params);

******************************************************************************

procedure Delete(const alias: String);

  Deletes a BDE alias.

******************************************************************************

function Exists(const alias: String): Boolean;

  Returns true if the specified BDE alias exists.

******************************************************************************

procedure Modify(const alias: String; the_params: TStrings);

  Modifies an existing BDE alias. Usage is similar to the Add function, except
that the alias must already exist and no driver is specified (the one for the
existing alias is used). Under normal circumstances, the parameter list for
the alias will be retrieved using the GetParams function, and changes made to
that parameter list before calling Modify.

  Example:

  AliasEditor.GetParams('MyAlias',AliasEditor.Params);
  AliasEditor.Params.Values['PATH'] := 'C:\MyOtherDirectory';
  AliasEditor.Modify('MyAlias',AliasEditor.Params);

******************************************************************************

procedure GetAliasList(the_params: TStrings);

  Get a list of available BDE aliases.

******************************************************************************

procedure GetDriverList(the_params: TStrings);

  Get a list of available database drivers. Notice that Paradox and DBase
will not be listed as separate drivers, as they are both handled by the
"STANDARD" driver.

******************************************************************************

procedure GetDriverParams(const driver_name: String; the_params: TStrings);

  Get a list of default parameters for the specified driver. To get the
Paradox and DBase default parameters use "STANDARD" as the driver name. This
method is particularly useful for client server databases which may have a
long list of parameters which need to be set up.

******************************************************************************

function GetDriver(const alias: String): String;

  Returns the driver name for a BDE alias.

******************************************************************************

procedure GetParams(const alias: String; the_params: TStrings);

  Gets the parameter list for a BDE alias.

******************************************************************************

function GetPath(const alias: String): String;

  Gets the path associated with a BDE alias. This function is provided for
convenience for use with DBase and Paradox aliases only, as Interbase
aliases do not have a path.

******************************************************************************

function GetType(const alias: String): String;

  Returns the type for a BDE alias.

******************************************************************************
