procedure TForm1.FirstConnectionBeforeConnect(Sender: TIB_Connection);
begin
with FirstConnection do begin
    if ( Protocol = cpLocal ) and not FileExists( DatabaseName ) then begin
      scMain.Execute;
    end;
  end;
end;