Jump to content
TurboMagic

Creating Firebird embedded backup fails

Recommended Posts

Posted (edited)

Hello,

 

I'm using D12.1, FireDAC and Firebird 5.0 embedded.

I try to create a backup using TFDIBBackup but that fails with this failure message:

"Unable to complete network request to host "xnet://Global

 [FireDAC][Phys][FB]invalid service handle

 [FireDAC][Phys][FB]invalid service handle"

 

I can successfully create a backup using gbak from command line though.
I'm also quite sure creating a backup from my application works when Firebird server is installed.

 

Here's my TFDIBBackup initialization code:

 

constructor TDBBackup.Create(const DatabaseFileName : string;
                             const VendorLib        : string);
begin
  inherited Create;

  FFBDriverLink             := TFDPhysFBDriverLink.Create(nil);
  FFBDriverLink.VendorLib   := VendorLib;
  FFBDriverLink.Embedded    := true;

  FFBBackup                 := TFDIBBackup.Create(nil);
  FFBBackup.ConnectTimeout  := 0;
  FFBBackup.Database        := DatabaseFileName;
  FFBBackup.DriverLink      := FFBDriverLink;
  FFBBackup.Password        := c_DBPassword;
  FFBBackup.QueryTimeout    := 2;
  FFBBackup.UserName        := c_DBUserName;
  FFBBackup.Verbose         := true;
  FFBBackup.Protocol        := TIBProtocol.ipLocal;

  FFBBackup.AfterExecute    := OnBackupFinishedInternal;
  FFBBackup.OnProgress      := OnBackupProgressInternal;
  FFBBackup.OnError         := OnBackupErrorInternal;

  FIsBackupRestoreActive    := false;
end;

Vendor lib points to a fbclient.dll which exists and has the other libraries for embedded in the same directory and all other fbclient.dlls
on the system are the exact same version and have the exact same other files in their directory:

 

fbclient.dll
firebird.conf
firebird.msg
gbak.exe
gfix.exe
ib_util.dll
icudt63.dll
icudt63l.dat
icuin63.dll
icuuc63.dll
isql.exe
msvcp140.dll
vcruntime140.dll
intl\fbintl.conf
intl\fbintl.dll
plugins\chacha.dll
plugins\engine13.dll

What am I'm doing wrong?
Regular DB SQL queries via FireDac work just fine.

 

Cheers

 

TurboMagic

Edited by TurboMagic

Share this post


Link to post

A solution was found now:
The FBDriverLink of the FDConnection used in the application must have Embedded := true as well!

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

×