RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSession.GetAliasNames Method

Populates a string list with the names of persistent Borland Database Engine (BDE) aliases.

Pascal
procedure GetAliasNames(List: TStrings);
C++
__fastcall GetAliasNames(TStrings List);

Call GetAliasNames to retrieve a list of persistent BDE aliases—those aliases that exist in persistent storage or in the BDE configuration file. List is a string list object, created and maintained by the application, into which to store the alias names. 

A session's ConfigMode property determines whether an alias created in the context of this session is reported by GetAliasNames. If ConfigMode is cmAll, aliases created within the session are reported.  

C++ Examples: 

 

/*
This example calls the TSession GetAliasNames method to fill
the list box with Borland Database Engine (BDE) alias names.
*/
void __fastcall TAdhocForm::Button1Click(TObject *Sender)
{
  TStringList *MyStringList = new TStringList();
  try
  {
    Session->GetAliasNames(MyStringList);
    // fill a list box with alias names for the user to select from
    for (int I = 0; I < MyStringList->Count; I++)
      ListBox1->Items->Add(MyStringList->Strings[I]);
  }
  __finally
  {
    delete MyStringList;
  }
}

 

Delphi Examples: 

{
This example calls the TSession GetAliasNames method to fill
the list box with Borland Database Engine (BDE) alias names.
}
procedure TAdhocForm.Button1Click(Sender: TObject);
var
  MyStringList: TStringList;
  I: Integer;
begin
  MyStringList := TStringList.Create;
  try
    Session.GetAliasNames(MyStringList);
    { fill a list box with alias names for the user to select from }
    for I := 0 to MyStringList.Count - 1 do
      ListBox1.Items.Add(MyStringList[I]);
  finally
    MyStringList.Free;
  end;
end;

 

ConfigMode 

AddAlias 

AddStandardAlias 

GetAliasDriverName 

GetAliasParams 

SaveConfigFile 

Retrieving Information About a Session 

Working with BDE Aliases

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!