Subject Re: [IBO] Aborting login
Author Helen Borrie
At 02:51 AM 18-09-02 +0000, you wrote:
>Hi there,
>I'm using the TIB_Connection component, and I have my own OnLogin
>event so I can display my own login box.
>
>If the user presses cancel on this box, how can I abort the login
>process?
>
>I cannot set the LoginAborted property as it is read-only, but when
>the user presses cancel, I still get the failed login error, and
>this pops up for the amount of times I have set in the LoginAttempts
>property.
>
>I'm sure this is simple, but cannot find some AbortLogin method..
>I've tried ForcedShutdown, and Close, but both leave the app hanging.

Ryan,
Try this:

procedure TForm1.IB_Connection1LoginFailure(Sender: TIB_Connection);
begin
Showmessage('Cancelling...');
Sysutils.Abort;

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
inherited;
if not ib_connection1.connected then
ib_connection1.connect;

end;

procedure TForm1.FormShow(Sender: TObject);
begin
if ib_connection1.connected then
inherited
else
Close;
end;

OnLoginFailure kicks in whenever login fails totally, i.e. after the set
number of login attempts or ultimately when there is no possibility of login.

Helen