Skip to main content
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ErrorMode = 0: File locked by another QlikView Process


I have a set of .qvd files and some documents that store/load data from them. The documents are scheduled in different time but sometimes (due to delays) they are running simoultaneously. If two documents trying to access the same .qvd at the same time the second one will find a lock and failed.

My goal is to resolve this situation automatically. I have tryed to implement something like

SET ErrorMode = 0;

STORE myTable INTO MyFilePath.qvd;

IF ScriptError > 0 THEN

  TRACE Data could not be stored in QVD, retrying...;

  SLEEP 5000; // 5 secs

  STORE myTable INTO MyFilePath.qvd;


So If the first attempt goes wrong I'll wait 5 seconds and try again. To simulate this I have opened with QlikView "MyFilePath.qvd" file and launched the reload of the main document. My issue is that the main document try to store the table in the file (that is locked), create an error and exit the procedure straight away.

It seems ignoring the ErrorMode = 0 that should force him to proceed on the script and wait 5 seconds before try again.

The returning error is "General Script Error". Does anyone faced this before? How can I resolve it? Are the "General Script Error" handled by QlikView? (On the QlikView documentation this error is not mapped on the ScriptError section)



10 Replies
Contributor III
Contributor III

Hi, I've modified a bit your script. I hope it will help somebody to overcome the problem.

SET ErrorMode = 0;

STORE myTable INTO MyFilePath.qvd;

IF ScriptError = 8 THEN

  LET vFileIsBusy = 1;

    Do While vFileIsBusy = 1

       STORE myTable INTO MyFilePath.qvd;

        if ScriptError <> 8 then

               LET vFileIsBusy = 0;