Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Tags (3)
1 Reply
sivarajs
Valued Contributor II

Re: How to condition if connected to ODBC?

 

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

Community Browser