Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
chris_johnson
Creator III
Creator III

Testing a connection

Hi all,

I've been having a scout around the forum but haven't found anything yet. Hopefully someone can tell me if this is possible...

Can you test a connection within QlikView script? I am having the problem that with a multi-database solution that one of the databases may be taken offline for some reason but this will crash the reload. Is there anything I can do about it?

Thanks,

Chris

1 Solution

Accepted Solutions
rbecher
MVP
MVP

Hi Chris,

may you can catch the ScriptError:

set ErrorMode=0;

CONNECT ...;

if ScriptError=9 then   // or ScriptError > 1

     //no connect...

end if

set ErrorMode=1;

- Ralf

Message was edited by: Ralf Becher Thanks for the hint Chris!

Astrato.io Head of R&D

View solution in original post

3 Replies
rbecher
MVP
MVP

Hi Chris,

may you can catch the ScriptError:

set ErrorMode=0;

CONNECT ...;

if ScriptError=9 then   // or ScriptError > 1

     //no connect...

end if

set ErrorMode=1;

- Ralf

Message was edited by: Ralf Becher Thanks for the hint Chris!

Astrato.io Head of R&D
chris_johnson
Creator III
Creator III
Author

Hi Ralf,

That's great! I'll have a play around with ErrorMode and ScriptError and I'm sure I'll come up with something. Can't say I've been aware of these in the past but I'll be sure to make a note of them and use them in the future.

Thanks a lot,

Chris

chris_johnson
Creator III
Creator III
Author

Got it working. Although looking at the help file for ScriptError it says that 1 = No Error. So I have amended the line to be:

if ScriptError > 1 then ...

This works now, thanks for your help.

Chris