unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, DBTables, Db;

type
  TForm1 = class(TForm)
    Session1: TSession;
    Button1: TButton;
    Button2: TButton;
    ListBox1: TListBox;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
 str:TString;
begin
 Session1.AddStandardAlias('VROnline','c:\','Paradox');
 Str:=TStringList.Create;
 Session1.GetAliasNames(Str);
 ListBox1.Items.Assign(Str);
 Str.Free;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
 L: TStringList;
begin
 L := TStringList.Create;
 try
  with L do
   begin
    Add('SERVER NAME=IB_SERVER:/PATH/DATABASE.GDB');
    Add('USER NAME=MYNAME');
   end;
  Session1.AddAlias('NewIB', 'InterBase 4.x Driver by Visigen',L);
 finally
  L.Free;
 end;
end;

procedure TForm1.FormShow(Sender: TObject);
var
 str:TStrings;
begin
 Str:=TStringList.Create;
 Session1.GetAliasNames(Str);
 ListBox1.Items.Assign(Str);
 Str.Free;
end;

end.
