Subject Re: [IBO] Aborting login
Author Ryan Nilsson-Harding
Hi Helen,
thanks for your reply.

I was more wondering how to cancel the login process before the
LoginAttempts had been maxed.
ie, before the LoginFailure event is fired.
Is there a way I can explicitly fire LoginFailure?

> 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