Subject | Re: [IBO] catching excpetion in TIB_Connection.Connect |
---|---|
Author | Helen Borrie |
Post date | 2002-09-23T07:13:25Z |
At 05:41 AM 23-09-02 +0000, you wrote:
There's an example in the Contact sample app. Here's the handler:
procedure TdmContact.cnContactBeforeConnect(Sender: TIB_Connection);
begin
// Dynamically create the sample GDB if it does not exist.
if ( cnContact.Protocol = cpLocal ) and
not FileExists( cnContact.Database ) then
scContact.Execute;
end;
Helen
> >What about using the BeforeConnect event to pre-empt a failure?
> > OnLoginFailure ?
>
>No, as this is only called once ALL login attempts have been made.
>I need to be able to catch the exception on the first failure, to
>determine if it is from not finding the gdb file.
There's an example in the Contact sample app. Here's the handler:
procedure TdmContact.cnContactBeforeConnect(Sender: TIB_Connection);
begin
// Dynamically create the sample GDB if it does not exist.
if ( cnContact.Protocol = cpLocal ) and
not FileExists( cnContact.Database ) then
scContact.Execute;
end;
Helen