Subject Re: [firebird-support] UIB error on backup
Author Bogusław Brandys
ainpoissee wrote:
> Hi!
>
> I'm using Unified Interbase 2 component TJvUIBBackup to make a backup
> of an FB database:
>
> BUp:= TJvUIBBackup.Create(nil);
> try
> BUp.LibraryName:= 'fbembed.dll';
> BUp.Database := 'TAPSERV:TAP';
> BUp.BackupFiles.Text:= 'c:\backup\tap.fbk';
> BUp.UserName:= 'user';
> BUp.PassWord:= 'pasw';
> BUp.Run;
> finally
> BUp.Free;
> end;
>
> and this code raises error:
>
> Error reading data from the connection.
> Unsuccessful execution caused by a system error that precludes
> successful execution of subsequent statements
> Error Code: 406.
>
> call stack is:
>
> [004A50F3] jvuiblib.RaiseException (Line 968, "jvuiblib.pas" + 9) + $2
> [004A52A7] jvuiblib.TUIBLibrary.CheckUIBApiCall (Line 997,
> "jvuiblib.pas" + 27) + $4
> [004A6629] jvuiblib.TUIBLibrary.ServiceStart (Line 2076,
> "jvuiblib.pas" + 5) + $24
> [004B7497] jvuib.TJvUIBBackupRestore.Run (Line 3493, "jvuib.pas" + 3)
> + $1A
>
> Now the backup file is created and it appears to be OK (ie I can
> restore DB from it) but why this error is raised?
>
> Also, it looks like this error is only raised when I create backup of
> remote database (TAPSERV:TAP) to local (client PC) drive. When running
> in embbeded mode (DB is on the same drive and connection string is
> c:\data\tap.fdb) no error is raised...
> Any idea?
>
>
> TIA
> ain
>

First : BackupFiles are *always* files located on server machine so path
'c:\backup\tap.fbk' must exists for remote TAPSERV machine.

Second:

Fix jvuiblib.pas , about line 988 replace
Exception.FErrorCode := GETCode(Status);
with
Exception.FErrorCode := FStatusVector[1];

and you will see proper GDS code number in exception message.

BTW: I cannot set alias name as backup file but I can set alias path.I
don't know if this is correct I thought that alias name is automatically
resolved to path.

Regards
Bogusław