TAliasEditor V01.03 - BDE alias management component for Delphi 3

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.

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

Directories:

There are 3 subdirectories:

install: Contains the files needed to install TAliasEditor on the component
         palette.

source:  Contains the source code for TAliasEditor, a .dcr file containing
         the palette icon and the package file (.dpk) used to create the
         installable files.

edtest:  Contains the test application.

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

Component Installation:

Copy the files in the install subdirectory to a suitable directory. Start
Delphi 3 and select Component|Install Packages from the menu. Click Add
and select PAliasEd.dpl in the directory you copied the installable
files to.

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, changing 'Samples' for the name of another tab and
re-compiling the package file.

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 3 Developer's 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 the files in the edtest
subdirectory to a suitable directory. Open EdTest.dpr from Delphi 3 and press
F9 to run the application.

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

Converting from Delphi 2:

Your Delphi 2 applications which use TAliasEditor should run with little or
no modification. Read the information below about the ConfigMode property
to learn how that has changed in Delphi 3.

If you are having problems loading a form which uses TAliasEditor and was
created in Delphi 2 it is most likely that the ConfigMode property is set
to something other than cmPersistent (the default for Delphi 2). To get the
form to load, you need to delete the value stored for the ConfigMode
property in the .dfm file. To do this, open the .dfm file separately using
the Delphi editor and delete the line which contains the value for the
ConfigMode property. You should now be able to load the form normally.

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

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
(cfmPersistent), local (cfmSession) or ODBC data sources and drivers
(cfmVirtual). Note that ConfigMode is a set property, and these values may be
combined as required.

The ConfigMode property affects only the alias editor component - the
ConfigMode property of Session is unaffected. The default is [cfmPersistent].

  See the Delphi on-line help for TSession.ConfigMode for further information
(NOTE: The description of cfmVirtual in the Delphi 3 help file is misleading.
For more hopefully correct (!) information on session modes see the BDE API
help file topic "sesCFGMODE2").

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

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.

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