Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Check Connection Status in Script

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.

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

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

View solution in original post

2 Replies
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

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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