Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to condition if connected to ODBC?

Hi,

Here's this scenario, I have connection to the VPN via ODBC, and at the same time I also have Excel files as back-up datasources. What will happen is that, whenever I got connected to the VPN, I want my application will load data coming from database, and when the VPN is down or disconnected - my application will read data from excel files.

Example algorithm,

If ODBC = CONNECTED

     get data from database

Else

     get data from excel file

End if

Please help me solving this problem. Thanks in advance.

Best Regards,

Bill

1 Reply
sivarajs
Specialist II
Specialist II

 

set

ErrorMode=0;

if scriprterror=4 then

get data from excel file

endif

4- Represents general ODBC error

See(scripterror) help for more definitions

--Siva