Qlik Community

QlikView Connectors

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

SQL Server ODBC Connector Hassle

When I move my document from my workstation to my QlikView server I have to rebuild the SQL Server ODBC connection string in order to connect to my data source as shown below. I would think that the same connection string would work on both machines provided the data sources are named and configured the same. This is a bit of a hassle and a source or reload errors when we forget to flip the comment tokens. Can anyone suggest what I'm mmissing missing here?

ODBC

CONNECT TO VMSProduction (XUserId is LGEJFJVMQbbEHaRIBDdCGIJOPDZUD, XPassword is MbGeFIVOMbcCGZBGRRPB); // Al's Workstation

//ODBC CONNECT TO [VMS Production] (XUserId is CHfQFJVMQbbEHaRIBDdCGIJOPDZCE, XPassword is YTbCJIVOMbcCGZBGRZTA); // QlikView Server







1 Solution

Accepted Solutions
Not applicable

SQL Server ODBC Connector Hassle

I guess I missed the obvious fact that "VMSProduction" is not the same data source name as "VMS Production". Oops ...

4 Replies
Not applicable

SQL Server ODBC Connector Hassle

I guess I missed the obvious fact that "VMSProduction" is not the same data source name as "VMS Production". Oops ...

SQL Server ODBC Connector Hassle

If the ODBC Connection String has been recreated with exactly the same name then you should be fine. ODBC may be useful when your Dev & Prod environments access a different physical database. If using ODBC then always use SYSTEM datasources, not USER datasources. Generally we recommend using OLEDB whenever possible because it does not require configuration outside the QlikView document and is often faster than ODBC. The OLEDB connection string would always connect to the same physical database though, so might not be appropriate in some restrictive change-control environments.

You could also set a Variable that indicated which environment you are in (Dev/Prod/etc) and use an IF statement to control the CONNECT statement.

Not applicable

SQL Server ODBC Connector Hassle

Hi,

Could you please explain how to use a variable to determine the environment (DEV or PROD) in order to be able to use different connection strings?

Thanks,

Sourabh

SQL Server ODBC Connector Hassle

One easy way to use conditional connection strings is to test the computername:

IF computername() = 'MYQVSERVER' THEN
SET str = x;
ELSE
SET str = y;
END IF

-Rob

Community Browser