Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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.

Tags (1)
1 Solution

Accepted Solutions

Re: Check Connection Status in Script

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

2 Replies
MVP & Luminary
MVP & Luminary

Re: Check Connection Status in Script

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

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