Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

odbc connect depending QlikViewVersion()

Hi, how could i choice to use "connect" or "connect32" depending one variable that have the Qlikview version?

I have the variable vVersion with this formula:

=IF(MID(QlikViewVersion(),1,INDEX(QlikViewVersion(),'.')-1)<=9,'CONNECT','CONNECT32')

Then there are errors using the next load script:

IF $(vVersion) = "CONNECT32" THEN

     ODBC CONNECT32 TO DATABASE;

ELSE

     ODBC CONNECT TO DATABASE;

ENDIF

LOAD *;

SQL SELECT *

FROM DATA;

Does any know hou to do it?

Thanks in advance, and Happy New Year!

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Your construction with an IF control statement should work - but you must use single quotes:

     IF $(vVersion) = 'CONNECT32' THEN

          ODBC CONNECT32 TO DATABASE;   

     ELSE

          ODBC CONNECT TO DATABASE;

     ENDIF

But even better would be to use the variable directly:

           ODBC $(vVersion) TO DATABASE;

 

HIC

View solution in original post

3 Replies
Not applicable
Author

Hello,

Happy new year to you.

Can you see if your ODBC connection is present in both programs :

%systemdrive%\Windows\SysWoW64

%systemdrive%\Windows\System32

The first manage the 32 bits ODBC connections and the second the 64.

You must create DATABASE in both of them.

Amand Dupretz

hic
Former Employee
Former Employee

Your construction with an IF control statement should work - but you must use single quotes:

     IF $(vVersion) = 'CONNECT32' THEN

          ODBC CONNECT32 TO DATABASE;   

     ELSE

          ODBC CONNECT TO DATABASE;

     ENDIF

But even better would be to use the variable directly:

           ODBC $(vVersion) TO DATABASE;

 

HIC

Not applicable
Author

Thanks! Finally using single quotes and removing '=' from formula was enough

Other mode without using variables could be:

IF IF(MID(QlikViewVersion(),1,INDEX(QlikViewVersion(),'.')-1)<=9,'CONNECT','CONNECT32') = 'CONNECT32' THEN

ODBC CONNECT32 TO DATABASE;

ELSE

     ODBC CONNECT TO DATABASE;

ENDIF

Regards