<?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 Re: QV9 DynamicUpdate delete problem with apostrophes in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/QV9-DynamicUpdate-delete-problem-with-apostrophes/m-p/149098#M27309</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kencho/Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if the above question is resolved or was it a bug in earlier version and resolved now.. But this is how I got through it in QV11 version&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requiremnet is to delete records with a specific list filenames.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub Deletefile()&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;Dim objADO&lt;BR /&gt;Dim objRs&lt;BR /&gt;Dim strSQL&lt;/P&gt;&lt;P&gt;'vCurrentSelections is variable with filenames to be deleted - separated by commas)&lt;BR /&gt;str= ActiveDocument.Variables("vCurrentSelections").GetContent().String &lt;/P&gt;&lt;P&gt;fstr=InStr(str,"Filename")&lt;BR /&gt;ct=len(str)&lt;/P&gt;&lt;P&gt;'inserting double quotes to match the syntax as similar to SQL&lt;BR /&gt;fnm=replace(fnml,",", chr(34)&amp;amp;","&amp;amp;chr(34))&lt;/P&gt;&lt;P&gt;AppPath = "S:\nostro management\IDLM\IDLM Tactical Tool\Phase I\After Run1\IDLM Database v1.1.accdb"&lt;/P&gt;&lt;P&gt;Set objADO = CreateObject("ADODB.Connection")&lt;/P&gt;&lt;P&gt;objADO.Open "Provider=Microsoft.ACE.OLEDB.12.0;" &amp;amp; "Data Source=" &amp;amp; AppPath &amp;amp; ";"&lt;/P&gt;&lt;P&gt;'msgbox("delete * from Basedata where Filename in "&amp;amp;chr(34)&amp;amp; fnm &amp;amp;chr(34))&lt;BR /&gt;objADO.Execute("delete * from Basedata where Filename in ("&amp;amp;chr(34)&amp;amp; fnm &amp;amp;chr(34)&amp;amp;")")&lt;/P&gt;&lt;P&gt;objADO.Close&lt;/P&gt;&lt;P&gt;Msgbox("Files deleted" )&lt;/P&gt;&lt;P&gt;end sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;kamal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Nov 2013 18:01:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-11-25T18:01:59Z</dc:date>
    <item>
      <title>QV9 DynamicUpdate delete problem with apostrophes</title>
      <link>https://community.qlik.com/t5/QlikView/QV9-DynamicUpdate-delete-problem-with-apostrophes/m-p/149095#M27306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;QV9 works fine for inserting data containing apostrophes into qv tables, but I am having a problem removing data containing apostrophes.&lt;/P&gt;&lt;P&gt;The following code works when apostrophes are not involved, but doesnothing if the field contains apostrophes:&lt;/P&gt;&lt;P&gt;query = "DELETE FROM Name WHERE NameSelected='" &amp;amp; mySelections.Item(i).text &amp;amp; "'"&lt;BR /&gt;ActiveDocument.DynamicUpdateCommand(query)&lt;/P&gt;&lt;P&gt;Replacing the single quote with two single quotes SHOULD work, but does not:&lt;/P&gt;&lt;P&gt;tempstring = Replace(mySelections.Item(i).text, "'", "''")&lt;BR /&gt;query = "DELETE FROM Name WHERE NameSelected='" &amp;amp; tempstring &amp;amp; "'"&lt;BR /&gt;ActiveDocument.DynamicUpdateCommand(query)&lt;/P&gt;&lt;P&gt;Ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2009 06:48:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QV9-DynamicUpdate-delete-problem-with-apostrophes/m-p/149095#M27306</guid>
      <dc:creator />
      <dc:date>2009-07-12T06:48:24Z</dc:date>
    </item>
    <item>
      <title>QV9 DynamicUpdate delete problem with apostrophes</title>
      <link>https://community.qlik.com/t5/QlikView/QV9-DynamicUpdate-delete-problem-with-apostrophes/m-p/149096#M27307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to replace apostrophes with &lt;B&gt;chr(39)&lt;/B&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 02:24:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QV9-DynamicUpdate-delete-problem-with-apostrophes/m-p/149096#M27307</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-07-13T02:24:38Z</dc:date>
    </item>
    <item>
      <title>QV9 DynamicUpdate delete problem with apostrophes</title>
      <link>https://community.qlik.com/t5/QlikView/QV9-DynamicUpdate-delete-problem-with-apostrophes/m-p/149097#M27308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;Thanks for the tip, but I've tried chr(39) every which way but up in the delete statements, to no avail.&lt;/P&gt;&lt;P&gt;Dynamic inserts work properly with embedded single quotes and no special handling (and, yes, I've tried replacing single quotes on the inserts and deletes with chr(39), double single quotes, chr(39)&amp;amp;chr(39), etcetera), but deletes simply do not work.&lt;/P&gt;&lt;P&gt;I've tried sticking chr(34)s (double quote) on the left and right (but not in the middle), and that does not help.&lt;/P&gt;&lt;P&gt;QlikView: do we have a bug? It appears so.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 16:53:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QV9-DynamicUpdate-delete-problem-with-apostrophes/m-p/149097#M27308</guid>
      <dc:creator />
      <dc:date>2009-07-13T16:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: QV9 DynamicUpdate delete problem with apostrophes</title>
      <link>https://community.qlik.com/t5/QlikView/QV9-DynamicUpdate-delete-problem-with-apostrophes/m-p/149098#M27309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kencho/Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if the above question is resolved or was it a bug in earlier version and resolved now.. But this is how I got through it in QV11 version&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requiremnet is to delete records with a specific list filenames.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub Deletefile()&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;Dim objADO&lt;BR /&gt;Dim objRs&lt;BR /&gt;Dim strSQL&lt;/P&gt;&lt;P&gt;'vCurrentSelections is variable with filenames to be deleted - separated by commas)&lt;BR /&gt;str= ActiveDocument.Variables("vCurrentSelections").GetContent().String &lt;/P&gt;&lt;P&gt;fstr=InStr(str,"Filename")&lt;BR /&gt;ct=len(str)&lt;/P&gt;&lt;P&gt;'inserting double quotes to match the syntax as similar to SQL&lt;BR /&gt;fnm=replace(fnml,",", chr(34)&amp;amp;","&amp;amp;chr(34))&lt;/P&gt;&lt;P&gt;AppPath = "S:\nostro management\IDLM\IDLM Tactical Tool\Phase I\After Run1\IDLM Database v1.1.accdb"&lt;/P&gt;&lt;P&gt;Set objADO = CreateObject("ADODB.Connection")&lt;/P&gt;&lt;P&gt;objADO.Open "Provider=Microsoft.ACE.OLEDB.12.0;" &amp;amp; "Data Source=" &amp;amp; AppPath &amp;amp; ";"&lt;/P&gt;&lt;P&gt;'msgbox("delete * from Basedata where Filename in "&amp;amp;chr(34)&amp;amp; fnm &amp;amp;chr(34))&lt;BR /&gt;objADO.Execute("delete * from Basedata where Filename in ("&amp;amp;chr(34)&amp;amp; fnm &amp;amp;chr(34)&amp;amp;")")&lt;/P&gt;&lt;P&gt;objADO.Close&lt;/P&gt;&lt;P&gt;Msgbox("Files deleted" )&lt;/P&gt;&lt;P&gt;end sub &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;kamal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Nov 2013 18:01:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QV9-DynamicUpdate-delete-problem-with-apostrophes/m-p/149098#M27309</guid>
      <dc:creator />
      <dc:date>2013-11-25T18:01:59Z</dc:date>
    </item>
  </channel>
</rss>

