Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Mahamed_Qlik
Specialist
Specialist

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
marcus_sommer

There is a typo within your include-statement:

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

 

Mahamed_Qlik
Specialist
Specialist
Author

Sorry i was type within my query only..

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

marcus_sommer

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

Brett_Bleess
Former Employee
Former Employee

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 do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.