Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
mahamedfaijan
Contributor II

Include using relative path issue

Hi 

 

I want to connect qlikview to my database using my connection string.

But, I want to save connection string in txt and i want to call this txt file in inlcude as below :

 

$(Inlcude= ..\Includes\Connection.txt);

 

So issue is, when I execute above script it is throwing an error of " there is no open data connection" but when I dont use this connection string txt file and I write full path as below then my script got executed correctly.

OLEDB CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=xxxxxxxxx;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=xxxxxxx;Use Encryption for Data=False;Tag with column collation when possible=False];

 

Please help asap.

Labels (1)
4 Replies
MVP & Luminary
MVP & Luminary

Re: Include using relative path issue

There is a typo within your include-statement:

$(Inlcude= ..\Includes\Connection.txt);

 

mahamedfaijan
Contributor II

Re: Include using relative path issue

Sorry i was type within my query only..

I have checked and it is corrected in application but still same issue

MVP & Luminary
MVP & Luminary

Re: Include using relative path issue

Then it seemed that your relative path isn't valide. The easiest way to get the proper relative path is to use the file-wizard with the enabled option to apply relative paths to load the include-file as a flat-file. You don't need to execute this load - just copy & paste the path from the from-statement and then remove the whole thing again.

Further useful is the use of must_include instead of include because then you will get an error-message if the access to the file failed.

- Marcus

Support
Support

Re: Include using relative path issue

Here is Help link to Include, Marcus is correct in his explanation of things as well.

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/Syste...

Here is a Microsoft link regarding relative paths as well:

https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats

Regards,
Brett

To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.