Recent

Author Topic: MSSQL howto catch a TMSSQLConnection Error without Messagebox?  (Read 2441 times)

af0815

  • Hero Member
  • *****
  • Posts: 1289
MSSQL howto catch a TMSSQLConnection Error without Messagebox?
« on: January 15, 2021, 11:55:35 am »
On my Raspi i got on a TMSSQLConnection a messagebox if the server is not reachable. The connection is not my problem, but i am not able to cach this exeption silent without poping up this messagebox.

The problem is, the messagebox pops up and want an OK or ABORT.
In my code i catch the exception, set a flag and reraise
Code: Pascal  [Select][+][-]
  1.     try
  2.       if IsOk then AConnection.Connected := true;
  3.     except
  4.       on E : Exception do begin
  5.         IsOk:=false;
  6.         raise;
  7.       end;
  8.     end;
  9.  

The calling function does this
Quote
  Result := false;
  try
    xxxxxxxx(IsOk);
    Result := true;
  except
    on E : Exception do begin
      //
    end;
  end;
So the exception should silent catched and i can handle if a connection is ok or not.

How can i avoid this unwanted box
« Last Edit: January 15, 2021, 11:57:18 am by af0815 »
regards
Andreas

 

TinyPortal © 2005-2018