2 Replies Latest reply: Feb 22, 2016 6:13 PM by Peter Cammaert RSS

    Check Connection Status in Script

    tuncay kabacaly

      Hi All,

       

      I need to know about connection state in my project script.

       

      Is there any way to check connection is succesful or not?

       

      Thanks.

        • Re: Check Connection Status in Script
          Marcus Sommer

          I don't think that this will be directly possible. But indirectly - you could run a very small and fast dummy-query which might return only one single record which could be checked - maybe within a check-loop with error-mode: ErrorHandling in Qlikview

           

          - Marcus

          • Re: Check Connection Status in Script
            Peter Cammaert

            Your connection is succesful when the CONNECT (or CONNECT32 or CONNECT64) statements return without an error (ScriptError = 0). By default, script execution is allowed to continue whenever the current statement succeeds.

             

            Checking for an unsuccessful connection is easier because on average that is the condition about which ample information is available. After a CONNECT, check for ScriptError<>0. On the other hand, by default the script engine will notify you about a failed connection in very clear wording, so you may not have any checking to do after all.

             

            Peter