How to set up flexible database logon

G'day!

Using Delphi C/S 3.0 with BDE 4.0, connecting to Oracle 7.x database:
I'm having trouble connecting to a TTable as part of a TDataModule.Database
in a
flexible way that allows switching either the DatabaseName or the UserName.
The TDataModule.Database supposedly has two ways of doing this:

(1) Setting LoginPrompt=true and responding to a username/password prompt
    each time the DatabaseName changes.  As shown below, this method works,
    but is clumsy for the user.

(2) Setting LoginPrompt=false, collecting the username/password in a custom
form,
    then using as Params[0],[1] as shown below.  This is the way I'd like
to do it
    to make DatabaseName changes transparent to the user.  The problem is I
can
    only get this to work with a particular DatabaseName and a particular
username.

  TDataModule.Database properties and connection results --
                                                                 (prompt)
  LoginPrompt  Params                              DatabaseName  UserName
Connection made?
  -----------  ----------------------------------  ------------  --------
-------------------------
  true         '', ''                              WHSEDSN1      USER1    
Yes  <-- Works but clumsy
  true         '', ''                              WHSEDSN1      USER2    
Yes  <--   "    "    "
  true         '', ''                              WHSEDSN2      USER1    
Yes  <--   "    "    "
  true         '', ''                              WHSEDSN2      USER2    
Yes  <--   "    "    "
  false        'USERNAME=USER1', 'PASSWORD=user1'  WHSEDSN1      --      
Yes  <-- Why works here
  false        'USERNAME=USER2', 'PASSWORD=user2'  WHSEDSN1      --      
No   <-- but not here
  false        'USERNAME=USER1', 'PASSWORD=user1'  WHSEDSN2      --      
No   <-- or here
  false        'USERNAME=USER1', 'PASSWORD=user2'  WHSEDSN2      --      
No   <-- or here

  If connection not made, the error message at "Table1.Active := true" is:
  "General SQL error. [Oracle][ODBC Oracle Driver] Connection not open."
  "Alias: WHSEDSN1" (or "Alias: WHSEDSN2")

  In the BDE Administrator, AutoODBC is set to true.  WHSEDSN1 and WHSEDSN2
are identical
  DSN's for the same Oracle database; they allow different clients to use
different DSN names.

  Simplified unit code is shown below for reference.  Thanks for any
insight!

  Sincerely,

  Jim Williams
  jw...@landolakes.com

//
----------------------------------------------------------------------------
---

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Grids, DBGrids, Db, DBTables, StdCtrls,
  {Custom units follow}
  Data;

type
  TForm1 = class(TForm)
    Button1: TButton;
    DBGrid1: TDBGrid;
    procedure ViewBtnClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);

begin
  with DataModule1.Database1 do begin
    Connected := false;

    LoginPrompt := true;           // or false
    Params[0] := '';               // or 'USERNAME=USER1' or
'USERNAME=USER2'
    Params[1] := '';               // or 'PASSWORD=user1' or
'PASSWORD=user2'
    DatabaseName := 'WHSEDSN1';    // or 'WHSEDSN2'

  end;
  with DataModule1.Table1 do begin
    Active := false;
    DatabaseName := DataModule1.Database1.DatabaseName;
    TableName := 'MYTABLE';
    Active := true;
  end;
end;

end.  {unit}

//
----------------------------------------------------------------------------
---

unit data;

interface

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

type
  TDataModule1 = class(TDataModule)
    Database1: TDatabase;
    DataSource1: TDataSource;
    Table1: TTable;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DataModule1: TDataModule1;

implementation

{$R *.DFM}

end.  {unit}

//
----------------------------------------------------------------------------
---