Jump to content
Andrea Magni

Backup FB3 Embedded through TIBBackup component

Recommended Posts

Hi, anybody had troubles performing a backup of a FB3 embedded database through the TIBBackup component?

 

Firebird 3 uses fbclient.dll as client library also for embedded connections so it seems there's something wrong in the TIBBackup component when determining the client library to use (FireDAC.Phys.IBWrapper unit, TIBLib.GetLibraryInfo function. Given sLib var is always 'fbclient.dll' it misses it is a Firebird embedded connection).

 

We tried to force fbclient.dll as vendor lib (giving a proper value to the DriverLink property of the TIBBackup instance, we also tried to set Embedded property of the driver link manually) but no way, it is always looking for fbembed.dll instead of the specified one (fbclient.dll).

A quick and dirty workaround is to copy the DLL (fbclient) with the old name (fbembed) but I would like to avoid this, if possible.

 

Any help would be appreciated. Maybe @Dmitry Arefiev may enlight us 😉

 

Thanks in advance

Share this post


Link to post

The VendorLib is setted right, as fbclient.dll, as Fireird 3 need.

 

The problem seems to be in FireDAC.Phys.IBWrapper.pas at line 16423 of procedure TIBLib.GetLibraryInfo

{$ELSE}
 sProd := UpperCase(Product);
 if Pos('FIREBIRD', sProd) <> 0 then begin
   FBrand := ibFirebird;
   FEmbedded := Pos('embed', sLib) > 0;
 end
 else if Pos('INTERBASE', sProd) <> 0 then begin
   FBrand := ibInterbase;
   FEmbedded := Pos('togo', sLib) > 0;
 end
 else
   FBrand := ibYaffil;
{$ENDIF}

 

 

has you can see delphi search for word "embed" in client library name (sLib is the file name of the VendorLib setted before)
I'm using Delphi 10.2.2

The problem appear to exists only for admnistration component like TIBBackup, TIBRestore and so on.

The normal connection with the TFBConnection componet work right.

 

Share this post


Link to post

Changing method to code below and setting FDPhysFBDriverLink1.Embedded to True will make it working. Without that the only workaround is to renamed fbclient.dll into fbembed.dll.

procedure TIBLib.LoadFB(const AVendorHome, AVendorLib: String;
  AEmbedded, AThreadSafe: Boolean);
{$IFNDEF FireDAC_IB_STATIC}
const
  C_FBClient: String = {$IFDEF MSWINDOWS} 'fbclient' {$ENDIF}
                       {$IFDEF POSIX} 'libfbclient' {$ENDIF} + C_FD_DLLExt;
  C_FBEmbed:  String = {$IFDEF MSWINDOWS} 'fbembed' {$ENDIF}
                       {$IFDEF POSIX} 'libfbembed' {$ENDIF} + C_FD_DLLExt;
{$ENDIF}
begin
  if AEmbedded then
    LoadBase(AVendorHome, AVendorLib, AThreadSafe {$IFNDEF FireDAC_IB_STATIC}, [C_FBEmbed, C_FBClient] {$ENDIF})
  else
    LoadBase(AVendorHome, AVendorLib, AThreadSafe {$IFNDEF FireDAC_IB_STATIC}, [C_FBClient, C_FBEmbed] {$ENDIF});
  if AEmbedded and (Version >= ivFB030000) then
    FEmbedded := True;
end;

 

  • Like 1
  • Thanks 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×