<?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 explain below macro code in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/explain-below-macro-code/m-p/310638#M114722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain below macro code, i had found it by google.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls can you explain, it will helps me a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub Connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set conn=CreateObject("ADODB.Connection")&lt;BR /&gt;conn.Open "CONQ"&lt;BR /&gt;set rs=CreateObject("ADODB.recordset")&lt;BR /&gt;risque = getVariable("Change")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set inventory = ActiveDocument.Fields("codeinv").GetPossibleValues&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 0 to inventory.Count-1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;' Database Update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; sql="UPDATE invd3 SET "&lt;BR /&gt; sql=sql &amp;amp; "risqueqte='" &amp;amp; risque &amp;amp; "'"&lt;BR /&gt; sql=sql &amp;amp; " WHERE codeinv='" &amp;amp; inventory.item(i).Text &amp;amp; "'"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; on error resume next&lt;BR /&gt; conn.Execute sql&lt;BR /&gt; if err &amp;lt;&amp;gt; 0 then&lt;BR /&gt; msgbox("No update permissions! " &amp;amp; err )&lt;BR /&gt; end if&lt;BR /&gt;'End of the Update&lt;BR /&gt;Next&lt;BR /&gt;conn.close&lt;BR /&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function getVariable(varName)&lt;BR /&gt; set v = ActiveDocument.Variables(varName)&lt;BR /&gt; getVariable = v.GetContent.String&lt;BR /&gt;end function&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jul 2011 09:10:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-07-27T09:10:38Z</dc:date>
    <item>
      <title>explain below macro code</title>
      <link>https://community.qlik.com/t5/QlikView/explain-below-macro-code/m-p/310638#M114722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone explain below macro code, i had found it by google.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls can you explain, it will helps me a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub Connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set conn=CreateObject("ADODB.Connection")&lt;BR /&gt;conn.Open "CONQ"&lt;BR /&gt;set rs=CreateObject("ADODB.recordset")&lt;BR /&gt;risque = getVariable("Change")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set inventory = ActiveDocument.Fields("codeinv").GetPossibleValues&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 0 to inventory.Count-1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;' Database Update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; sql="UPDATE invd3 SET "&lt;BR /&gt; sql=sql &amp;amp; "risqueqte='" &amp;amp; risque &amp;amp; "'"&lt;BR /&gt; sql=sql &amp;amp; " WHERE codeinv='" &amp;amp; inventory.item(i).Text &amp;amp; "'"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; on error resume next&lt;BR /&gt; conn.Execute sql&lt;BR /&gt; if err &amp;lt;&amp;gt; 0 then&lt;BR /&gt; msgbox("No update permissions! " &amp;amp; err )&lt;BR /&gt; end if&lt;BR /&gt;'End of the Update&lt;BR /&gt;Next&lt;BR /&gt;conn.close&lt;BR /&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function getVariable(varName)&lt;BR /&gt; set v = ActiveDocument.Variables(varName)&lt;BR /&gt; getVariable = v.GetContent.String&lt;BR /&gt;end function&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 09:10:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/explain-below-macro-code/m-p/310638#M114722</guid>
      <dc:creator />
      <dc:date>2011-07-27T09:10:38Z</dc:date>
    </item>
    <item>
      <title>explain below macro code</title>
      <link>https://community.qlik.com/t5/QlikView/explain-below-macro-code/m-p/310639#M114723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It updates rows in a database based on a variable content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why don't you just post what your problem is instead of googling for unknown code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2011 19:50:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/explain-below-macro-code/m-p/310639#M114723</guid>
      <dc:creator>danielrozental</dc:creator>
      <dc:date>2011-07-27T19:50:11Z</dc:date>
    </item>
  </channel>
</rss>

