Hallo folks,

for creating a backup inside a report I have the following function DbBackup:

function DbBackup()
{
    var ADB   = ArisData.getActiveDatabase();
    var oFile;
    var oDbAdmin;
    var lOK;
    var sPath = "C:\\Download";
    var sFile = "WorkDB "+Date();

    Context.setSelectedPath(sPath);
    Context.setSelectedFile(sFile);
    oFile     = new java.io.File(sPath, sFile);
    oDbAdmin  = Context.getComponent("ServerAdmin");
    lOK       = oDbAdmin.backupDatabase(ADB, oFile);

    return;
}

 

This function runs through without creating an error.
But unfortunately it does not create any backup file and the answer of "oDbAdmin.backupDatabase(ADB, oFile)" is "false". (lOK = false)
The path "C:\Download" exists on my computer and I run the report on my local server for development.
When starting a backup of this database manually I have no problems. That works fine.

Now I would be very happy if anybody can help me and show me where my mistake is.
Many thanks in advance,
Holger

Tags: ARIS Report Scripting