TFBAdmin - How do I tell if it's already connected? lazarus / 16-Databases ---------------------------------------------------------------------- RedOctober · 2017-12-31 23:59 Platform:  Windows Server 2016, Lazarus 1.9  Fpc 3.1.1 The TFBAdmin component doesn't have a ".Active" or ".Connected" property.  It has a private ".CheckConnected" property, but I cannot get at it, other than making my own wrapper for the TFBAdmin component which I'd rather not do.  If I try to .Connect to the TFBAdmin component and it's already connected, it throws an error saying it's already connected. If I try to .Disconnect to the TFBAdmin component and it's already disconnected, it throws an error saying it's already disconnected. Am I doing this wrong?  No examples show how to test if it's disconnected or connected.  The examples just connect/disconnect as if the connection was successful, or as if it was disconnected in the first place. ---------------------------------------------------------------------- balazsszekely · 2018-01-01 07:11 Inside TFBAdmin.Connect function, instead of: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  if FSvcHandle<>FB_API_NULLHANDLE then    raise EIBDatabaseError.CreateFmt(SErrConnected,[Self.Name],nil,0,'');should be: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  if (FSvcHandle<>FB_API_NULLHANDLE) and (FUseExceptions)  then    raise EIBDatabaseError.CreateFmt(SErrConnected,[Self.Name],nil,0,'');Then you could change the behaviour by setting UseExceptions property to false. You should file in a bug report or even better create a patch where a new Connected property is available. All you have to do is check in the getter method if FSvcHandle<>FB_API_NULLHANDLE. However if your time is limited, just try except the connect/disconnect function and you're good to go, like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses IBConnection;//...try   FBAdmin1.Connect;except  on E: EIBDatabaseError do  begin    //already connected, do something  end;end;Please note, this will still raise a debugger exception inside the IDE(you can choose to ignore it) however your executable will run fine outside the IDE.