<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Garbage After Statement - Using Text File For Connection String in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Garbage-After-Statement-Using-Text-File-For-Connection-String/m-p/1261448#M846775</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I have multiple dashboards all using the same ID, it makes sense to me to create a text file with the connection string in it, with the ID, password, database, etc and then call that file from each dashboard using an include statement.&amp;nbsp; I'm currently testing it with just one dashboard and I'm getting the "Garbage after statement error".&amp;nbsp; A window pops up with that error message and once I click OK, the load script executes and I get connected to the database.&amp;nbsp; However, once the dashboard goes live, it will be run as a task via QMC.&amp;nbsp; Thus it will fail as you can't click OK.&amp;nbsp; Here's what is stored in the text file (note some values have been changed since they shouldn't be public, i.e. Source, Catalog, Password, etc):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vConnectionString='{OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=USER1234;Initial Catalog=info;Data Source=my.database.server\SESSION;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=CHCAR10C38N1;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is NotARealPassword)}';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have in my load script on the Main tab.&amp;nbsp; There are then other tabs that get executed.&amp;nbsp; As a side note, I previously had the connection string in the load script and it ran fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 12pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 10pt;"&gt;$(Include=..\Config\DevSourcesI680656.txt)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;CONNECT&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;TO&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;[$(vConnectionString)]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;As always, any and all help is appreciated.&amp;nbsp; Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>pnn44794</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Garbage After Statement - Using Text File For Connection String</title>
      <link>https://community.qlik.com/t5/QlikView/Garbage-After-Statement-Using-Text-File-For-Connection-String/m-p/1261448#M846775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I have multiple dashboards all using the same ID, it makes sense to me to create a text file with the connection string in it, with the ID, password, database, etc and then call that file from each dashboard using an include statement.&amp;nbsp; I'm currently testing it with just one dashboard and I'm getting the "Garbage after statement error".&amp;nbsp; A window pops up with that error message and once I click OK, the load script executes and I get connected to the database.&amp;nbsp; However, once the dashboard goes live, it will be run as a task via QMC.&amp;nbsp; Thus it will fail as you can't click OK.&amp;nbsp; Here's what is stored in the text file (note some values have been changed since they shouldn't be public, i.e. Source, Catalog, Password, etc):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vConnectionString='{OLEDB CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=True;User ID=USER1234;Initial Catalog=info;Data Source=my.database.server\SESSION;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=CHCAR10C38N1;Use Encryption for Data=False;Tag with column collation when possible=False] (XPassword is NotARealPassword)}';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have in my load script on the Main tab.&amp;nbsp; There are then other tabs that get executed.&amp;nbsp; As a side note, I previously had the connection string in the load script and it ran fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 12pt;"&gt;&lt;EM&gt;&lt;STRONG style="font-size: 10pt;"&gt;$(Include=..\Config\DevSourcesI680656.txt)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;BR /&gt; &lt;STRONG style=": ; color: #0000ff;"&gt;CONNECT&lt;/STRONG&gt; &lt;SPAN style="color: #0000ff;"&gt;TO&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;[$(vConnectionString)]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;As always, any and all help is appreciated.&amp;nbsp; Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Garbage-After-Statement-Using-Text-File-For-Connection-String/m-p/1261448#M846775</guid>
      <dc:creator>pnn44794</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Garbage After Statement - Using Text File For Connection String</title>
      <link>https://community.qlik.com/t5/QlikView/Garbage-After-Statement-Using-Text-File-For-Connection-String/m-p/1261449#M846776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Perry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just had a play, Just put the actual connection string in your .txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. my file is connect.txt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OLEDB CONNECT TO [Provider=SQLOLEDB.1;Password=bpi;Persist Security Info=True;User ID=bpi;Initial Catalog=NHS_SLR;Data Source=(local);Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=CSD005779-DW7;Use Encryption for Data=False;Tag with column collation when possible=False]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then the includes statement using the insert includes statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #808080; font-size: 10pt;"&gt;&lt;EM&gt;&lt;STRONG&gt;$(Include=connect.txt)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and that's it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;save and reload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 16:48:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Garbage-After-Statement-Using-Text-File-For-Connection-String/m-p/1261449#M846776</guid>
      <dc:creator>awhitfield</dc:creator>
      <dc:date>2017-03-22T16:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Garbage After Statement - Using Text File For Connection String</title>
      <link>https://community.qlik.com/t5/QlikView/Garbage-After-Statement-Using-Text-File-For-Connection-String/m-p/1261450#M846777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked.&amp;nbsp; Thank you very much Andrew.&amp;nbsp; The code I was using was from another thread related to using a text file to store your connection string and they used "CONNECT TO" as I had above.&amp;nbsp; Removed that and I was good to go.&amp;nbsp; Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 17:10:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Garbage-After-Statement-Using-Text-File-For-Connection-String/m-p/1261450#M846777</guid>
      <dc:creator>pnn44794</dc:creator>
      <dc:date>2017-03-22T17:10:08Z</dc:date>
    </item>
  </channel>
</rss>

