<?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: Insert Qlikview straight table data into access database in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404829#M803779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To write data into a database you need an insert- or an update-statement and not a select which only queried exists data. Here a few examples from the community:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/367983"&gt;Re: QlikView data into SQL&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/34255"&gt;Insert / Update data into MSSQL&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it's an alternatively to overwrite with your export or maybe a store-statement an existing csv-file which Access used as an external data-sources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Nov 2017 14:43:04 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2017-11-16T14:43:04Z</dc:date>
    <item>
      <title>Insert Qlikview straight table data into access database</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404828#M803778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After I managed (with your help) to "pull" data from Qlikview into Excel (with Excel VBA), I need now to push from inside Qlikview (VB script linked to a button on the sheet) to an Access database.&lt;/P&gt;&lt;P&gt;I set up the database connection: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set DbConn = CreateObject("ADODB.Connection")&lt;/P&gt;&lt;P&gt;StrConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= test.accdb;Persist Security Info=False;"&lt;/P&gt;&lt;P&gt;DDbConn.Open StrConn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and identified the Straight table in Qlikview:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set TableBox = ActiveDocument.GetSheetObject("CH195")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then I got the TableBox.GetRowCount for later stepping through each row (record) and insert into the Access table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I'm stuck and hope that one or some of you can get me back on track:&lt;/P&gt;&lt;P&gt;1. How to set the access recordset - I tried:&lt;/P&gt;&lt;P&gt;Set DB = currentDB()&lt;/P&gt;&lt;P&gt;SqlStr = _&lt;/P&gt;&lt;P&gt;"SELECT * " &amp;amp; _&lt;/P&gt;&lt;P&gt;"FROM PRODUCTION"&lt;/P&gt;&lt;P&gt;Set rs = db.OpenRecordset(SqlStr, dbOpenDynaset)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this is not working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I get this working, I plan to loop through each record from TableBox and insert into the "Production" table in Access&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quite lost though...&lt;/P&gt;&lt;P&gt;hope someone can help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Matt&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/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404828#M803778</guid>
      <dc:creator>desertmatt</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Qlikview straight table data into access database</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404829#M803779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To write data into a database you need an insert- or an update-statement and not a select which only queried exists data. Here a few examples from the community:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/367983"&gt;Re: QlikView data into SQL&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/34255"&gt;Insert / Update data into MSSQL&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe it's an alternatively to overwrite with your export or maybe a store-statement an existing csv-file which Access used as an external data-sources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Nov 2017 14:43:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404829#M803779</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-11-16T14:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Qlikview straight table data into access database</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404830#M803780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much! From the links provided I could reconstruct below code which beautifully works with an access 2016 database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub DbWrite()&lt;BR /&gt;dim sServer, sConn, oConn, oRST&lt;BR /&gt; &lt;BR /&gt;sConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Documents\test-DB-CONNECT.accdb;Persist Security Info=False;"&lt;/P&gt;&lt;P&gt;Set oConn = CreateObject("ADODB.Connection")&lt;BR /&gt;oConn.Open sConn&lt;BR /&gt; &lt;BR /&gt;Set oTT =CreateObject("ADODB.Recordset") &lt;/P&gt;&lt;P&gt;oTT.open "table1", oConn&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Set oRST =CreateObject("ADODB.Recordset")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;'First empty the table (Delete all records)&lt;BR /&gt;oRST.open "DELETE * FROM table1", oConn&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set table = ActiveDocument.GetSheetObject("CH01")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For RowIter = 2 to table.GetRowCount-1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set ProductNo = table.GetCell(RowIter,0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Price = table.GetCell(RowIter,1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set Wt = table.GetCell(RowIter,2)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set PCS = table.GetCell(RowIter,3)&lt;BR /&gt; &lt;BR /&gt;SqlStr="INSERT INTO table1 (ProductNo,Wt,Price,PCS) values('" &amp;amp; ProductNo.Text &amp;amp; "','" &amp;amp; Wt.Number &amp;amp; "','" &amp;amp; Price.Number &amp;amp; "','" &amp;amp; PCS.Number &amp;amp; "')"&lt;BR /&gt;oRST.open SqlStr, oConn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;/P&gt;&lt;P&gt;oConn.Close&lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have one more "stupid" question - couldn't find this anywhere. I wanted to add a field "Production Date" in Qlikview and Access.&lt;/P&gt;&lt;P&gt;But if I add this to the sqlStr like ProdDate.date it throws an error "Object doesn't support this property or method: 'ProdDate.date' " - if I make it ProdDate.text I get a type mismatch.&lt;/P&gt;&lt;P&gt;How to specify the field as date field in the SqlStr - hope I don't embarrass myself not too much &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank your very much again for your support&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2017 12:33:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404830#M803780</guid>
      <dc:creator>desertmatt</dc:creator>
      <dc:date>2017-11-17T12:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Qlikview straight table data into access database</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404831#M803781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need separate statements to the insert statement to create or alter tables/fields with SQL, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ALTER TABLE table1 ADD "Production Date" DATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A good starting point fr it could you find here: &lt;A href="https://msdn.microsoft.com/de-de/library/office/ff196148.aspx" title="https://msdn.microsoft.com/de-de/library/office/ff196148.aspx"&gt;ALTER TABLE-Anweisung (Microsoft Access SQL)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in QlikView you couldn't add a table or a field from the macro - they must be created within the load-script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2017 12:49:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404831#M803781</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-11-17T12:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Qlikview straight table data into access database</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404832#M803782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is also interesting but maybe a misunderstanding? I'm at the beginner level (ALTER table I can try later maybe...;-))&lt;/P&gt;&lt;P&gt;All I did was to add one Date field in the Qlikview and ACCESS tables (manually - not by code)&lt;/P&gt;&lt;P&gt;All the other fields in my code were either .txt or .number format - but now if I want to write the data from Qlikview to Access with the extra date formatted field,&amp;nbsp; I get the above errors and I just need to know how to write the "ProdDate.???" field in the SqlStr - to avoid the errors?&lt;/P&gt;&lt;P&gt;Hope I was more clear this time (Or maybe I didn't understand the Alter table method??)&lt;/P&gt;&lt;P&gt;Thank you again&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2017 13:40:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404832#M803782</guid>
      <dc:creator>desertmatt</dc:creator>
      <dc:date>2017-11-17T13:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Qlikview straight table data into access database</title>
      <link>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404833#M803783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok. I understand it now. ProdDate.date isn't a valid statement because getcell hasn't any datatype else each content will be treated as string or number. This meant you need to use ProdDate.text. The mismatch-error happens because the date-format from QlikView is different to them from the Access field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if Access and/or the oledb driver will convert a date-string like 17.11.2017 into 43056 which is the real value which would be stored in Access for a date even if it will be displayed as (anyhow defined) date-format-string. You could try some trial &amp;amp; error which way worked or you just used a pure numeric value like 43056 for it either within your qlik-field or per converting within the macro - maybe per cdate() or some other logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Nov 2017 15:02:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Insert-Qlikview-straight-table-data-into-access-database/m-p/1404833#M803783</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-11-17T15:02:11Z</dc:date>
    </item>
  </channel>
</rss>

