Subject Re: [IBO] IBD_Login question
Author roberto_nahum
--- In IBObjects@yahoogroups.com, "Alan McDonald" <alan@m...> wrote:
> > >procedure TdmMyDm.cn1BeforeConnect(Sender: TIB_Connection);
> > >begin
> > > // if LoginAborted then
> >
> > if Sender.LoginAborted then
> >
> > > begin
> > > ShowMessage('Login cancelled'); // only if you want to
> > give feedback
> > > Sysutils.Abort;
> > > end
> > > else
> > > inherited;
> > >end;
>
> Funny, but before connected gets called before the login dialog
comes up, so
> cacellation does occur here
> Alan

I had the same problem and following your message I did some
investigations.
I found that changing the call to Abort with Exit on line 1192 of
IBA_Connection.IMP allows me to check the value of LoginAborted after
calling IB_Connection.Connect
So to close the application now I can, in the main form, use:

IB_Connection1.Connect;
if IB_Connection1.LoginAborted then
Close;

I don't see any side effect by now. Maybe the modification can be
included in the official IBA_Connection.IMP?

Roberto