Problem with logon to (local) Paradox table

Problem with logon to (local) Paradox table

When I use the code below, there is a problem.

{-------------------------}
procedure TForm1.PasswordProc(Sender: TObject; Var Continue :
Boolean);
Begin
  Session.RemoveAllPasswords;
  Session.AddPassword(psswrd);
  Continue := True;
End;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Session.OnPassword := PasswordProc;
  Table1.Active := True;
end;
{-------------------------}

What is happening:
After clicking the button, and string psswrd holds the right password,
Table1 becomes active. This works fine.
However, if the password is wrong, the application locks up when
setting Tabel1's property active to true.

What do I want to happen:
If the password provided by the user is wrong, I want to show a
message.
I want to prevent the application from locking up and I don't want to
use the default login screen from the DBE.

What should I do? Please give an example.

Thank you,
Robert