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: 
Anonymous
Not applicable

how to create connection string fiels(.cfg)?

how to create connection string fiels(.cfg)?

1 Reply
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You're a bit sparse on details, but let's assume that you want to keep your connection string external to your model. One way to do this is as follows:

Put your entire CONNECT statement in a simple text file, for example "fiels.cfg" from your thread title. Create this file in Notepad, and enter the following:

ODBC CONNECT TO [connectionstring];

or

OLEDB CONNECT TO [connectionstring];

Replace connectionstring with the actual Connection String you configured using the Connect-wizard. Place the file "fiels.cfg" in the same directory as your QlikView document.

Now in your QlikView document, open the script editor and enter the following before any SQL statements you may have listed:

$(INCLUDE=.\fiels.cfg);

This will tell the QlikView engine to replace the INCLUDE statement with the text found in the specified file. You now have a method to change/adjust connection strings on the fly (e.g. for development or production databases) without touching your QlikView document.

Best,

Peter