<?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 Update and external Database with a Macro. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141652#M21267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Basically, you have to write a macro (VB or Javascript) to do it.&lt;/P&gt;&lt;P&gt;You can use ODBC or OLEDB connection to your database.&lt;/P&gt;&lt;P&gt;You can find information of the connection by going on google and type ADODB (it is a kind of universal connector.&lt;/P&gt;&lt;P&gt;Using it you will just have to create your SQL sentence the same way you are doing it in other applications.&lt;/P&gt;&lt;P&gt;I could provide you with some example if you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2009 01:00:21 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-07-15T01:00:21Z</dc:date>
    <item>
      <title>Update and external Database with a Macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141647#M21262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Does anyone as and exemple of a macro updating a Database using ODBC ..&lt;/P&gt;&lt;P&gt;I saw some discussions about it , but I was not able to find a definite answer about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 03:30:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141647#M21262</guid>
      <dc:creator />
      <dc:date>2009-04-17T03:30:33Z</dc:date>
    </item>
    <item>
      <title>Update and external Database with a Macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141648#M21263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We use to have a button, calling a macro function with the following code:&lt;/P&gt;&lt;P&gt;function ABC()&lt;/P&gt;&lt;P&gt;Dim objShell, WshShell&lt;BR /&gt; set objShell = CreateObject("WScript.Shell")&lt;BR /&gt; objShell.SendKeys "^+r"&lt;/P&gt;&lt;P&gt;end function&lt;/P&gt;&lt;P&gt;By clicking on the button, it will rerun your "Load" script, causing a reload to run to update your .qvw file.&lt;/P&gt;&lt;P&gt;But do note that this run on the Enterprise Version and will not work in the Server. In Server, you have to use the publisher to reload.&lt;/P&gt;&lt;P&gt;Above is accurate based only on our own finding, please let me know if it is not true.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Say Chao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 15:28:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141648#M21263</guid>
      <dc:creator />
      <dc:date>2009-04-21T15:28:38Z</dc:date>
    </item>
    <item>
      <title>Update and external Database with a Macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141649#M21264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are trying to update a database, you need to understand VBScript in relation to ODBC connections (sorry, I don't). You need an ODBC connection configured, then can use that connection in your macro script using...&lt;/P&gt;&lt;P&gt;set conn = createobject("adodb.connection")&lt;/P&gt;&lt;P&gt;conn.open "dsn=mydsn;uid=myuser;password=mypassword;" // use correct values&lt;/P&gt;&lt;P&gt;the rest depends on what you want to do next. When you have written your code you can link it to a button.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 18:31:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141649#M21264</guid>
      <dc:creator />
      <dc:date>2009-04-21T18:31:53Z</dc:date>
    </item>
    <item>
      <title>Update and external Database with a Macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141650#M21265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot ! That works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 03:43:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141650#M21265</guid>
      <dc:creator />
      <dc:date>2009-04-28T03:43:36Z</dc:date>
    </item>
    <item>
      <title>Update and external Database with a Macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141651#M21266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Philippe and others,&lt;/P&gt;&lt;P&gt;I was wondering how does it work. We want to export the snapshot to an external database (Access or SQL Server) from QlikView but have no clue how to go about it. Please give some hints.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 23:44:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141651#M21266</guid>
      <dc:creator />
      <dc:date>2009-07-14T23:44:52Z</dc:date>
    </item>
    <item>
      <title>Update and external Database with a Macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141652#M21267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Basically, you have to write a macro (VB or Javascript) to do it.&lt;/P&gt;&lt;P&gt;You can use ODBC or OLEDB connection to your database.&lt;/P&gt;&lt;P&gt;You can find information of the connection by going on google and type ADODB (it is a kind of universal connector.&lt;/P&gt;&lt;P&gt;Using it you will just have to create your SQL sentence the same way you are doing it in other applications.&lt;/P&gt;&lt;P&gt;I could provide you with some example if you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 01:00:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141652#M21267</guid>
      <dc:creator />
      <dc:date>2009-07-15T01:00:21Z</dc:date>
    </item>
    <item>
      <title>Update and external Database with a Macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141653#M21268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;Thanks for the response. Can you please provide a simple example of exporting a single list box to any database (i.e. Acess). I am able to do it from Excell to Access but not directly from QlikTech to Access.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;Kashif&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 01:08:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141653#M21268</guid>
      <dc:creator />
      <dc:date>2009-07-15T01:08:46Z</dc:date>
    </item>
    <item>
      <title>Update and external Database with a Macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141654#M21269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample of an update ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Philippe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub Connection&lt;BR /&gt;&lt;BR /&gt;set conn=CreateObject("ADODB.Connection")&lt;BR /&gt;conn.Open "YOUR ODBC CONNECTION"&lt;BR /&gt;set rs=CreateObject("ADODB.recordset")&lt;BR /&gt;risque = getVariable("Change")&lt;BR /&gt;&lt;BR /&gt;set inventory = ActiveDocument.Fields("codeinv").GetPossibleValues 'This field is inside a list box&lt;BR /&gt;&lt;BR /&gt;for i = 0 to inventory.Count-1 ' To take all the values into account&lt;BR /&gt;'&lt;BR /&gt;' Update of the inventory table&lt;BR /&gt;'&lt;BR /&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;BR /&gt;&lt;BR /&gt; on error resume next&lt;BR /&gt;&lt;BR /&gt; conn.Execute sql&lt;BR /&gt;&lt;BR /&gt; if err &amp;lt;&amp;gt; 0 then&lt;BR /&gt; msgbox("No update permissions! " &amp;amp; err )&lt;BR /&gt; else&lt;BR /&gt; msgbox("Record " &amp;amp; nom &amp;amp; " was updated!")&lt;BR /&gt; end if&lt;BR /&gt;&lt;BR /&gt;' End of the update&lt;BR /&gt;&lt;BR /&gt;Next&lt;BR /&gt;conn.close&lt;BR /&gt;end sub&lt;BR /&gt;&lt;BR /&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 01:24:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141654#M21269</guid>
      <dc:creator />
      <dc:date>2009-07-15T01:24:22Z</dc:date>
    </item>
    <item>
      <title>Update and external Database with a Macro.</title>
      <link>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141655#M21270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the variable to load the table (see the example below), however its not advisable to load table using Qlikview, it will table several minutes to just load 500-1000 rows.;&lt;/P&gt;&lt;P&gt;LET vOHNumRows = NoOfRows('Table');&lt;BR /&gt;LET vOHLoadRows = 0;&lt;BR /&gt;&lt;BR /&gt;FOR I = 0 TO $(vOHNumRows) - 1&lt;BR /&gt; LET vField1 = peek('Field1', $(I), 'Table');&lt;BR /&gt; LET vField2 = Date(peek('Field2', $(I), 'Table'),'YYYY-MM-DD');&lt;BR /&gt; LET vField3 = peek('Field3', $(I), 'Table');&lt;BR /&gt;&lt;BR /&gt; SQL INSERT INTO qv.DBTable (DBField1,DBField2,DBField13)&lt;BR /&gt; values ('$(vField1)','$(vField2)','$(vField)');&lt;BR /&gt;&lt;BR /&gt; LET vOHLoadRows = $(vOHLoadRows) + 1;&lt;BR /&gt;Next&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2009 01:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-and-external-Database-with-a-Macro/m-p/141655#M21270</guid>
      <dc:creator />
      <dc:date>2009-07-15T01:30:15Z</dc:date>
    </item>
  </channel>
</rss>

