<?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 AW:Re: Trying to write data on a remote SQL Server db with ADO object and OLEDB in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trying-to-write-data-on-a-remote-SQL-Server-db-with-ADO-object/m-p/222037#M503055</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you got a little error in your connection string. The "UserId" must be typed with a blank to look "User Id"&lt;/P&gt;&lt;P&gt;This line should work for you:&lt;/P&gt;&lt;P&gt;url = "Provider=sqloledb;Data Source=server_name;Initial Catalog=db_name;User Id=xxxx;Password=xxxx"&lt;/P&gt;&lt;P&gt;Helmut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jul 2010 14:48:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-07-28T14:48:17Z</dc:date>
    <item>
      <title>Trying to write data on a remote SQL Server db with ADO object and OLEDB</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-write-data-on-a-remote-SQL-Server-db-with-ADO-object/m-p/222035#M503053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;in my QlikView application I need to upload data from txt/csv files (previously uploaded) and write them on a remote SQL Server DB using OLEDB driver.&lt;/P&gt;&lt;P&gt;Reading this forum I found the utilisation of ADO technology as unique solution, inserting it into a macro.&lt;/P&gt;&lt;P&gt;I tried to create a basic vbscript function to insert one record in db.&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;sub dbInsert&lt;BR /&gt;dim sConn, oRS, sSQL&lt;BR /&gt;&lt;BR /&gt; set sConn = CreateObject("ADODB.Connection")&lt;BR /&gt; url = "Provider=sqloledb;Data Source=server_name;Initial Catalog=db_name;UserId=xxxx;Password=xxxx"&lt;BR /&gt; sConn.open url&lt;BR /&gt; set oRS =CreateObject("ADODB.Recordset")&lt;BR /&gt; sSQL="INSERT INTO STG.STG_PROVA_INSERT (FATTURA_RIGA_ID, FATTURA_ID, PRODOTTO_ID, CONTRATTO_ID, PUNTO_ID, VERSIONE_ID, NUMERO_FISCALE, RIGA_CD) VALUES (0,0,0,0,0,0,"","")"&lt;BR /&gt; oRS.Open sSQL, sConn, adOpenDynamic, adLockOptimistic, adCmdUnspecified&lt;BR /&gt; rem set oRS = sConn.execute(sSQL)&lt;BR /&gt; oRS.close&lt;BR /&gt; set oRS = Nothing&lt;BR /&gt; sConn.commit&lt;BR /&gt; sConn.close&lt;BR /&gt; set sConn = Nothing&lt;BR /&gt;end sub&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;The execution fails with command "sConn.open url", I think because the compiler doesn't solve "CreateObject("ADODB.Connection")" call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any clues? Tips? Tricks? Would really appreciate it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alessandro&lt;/P&gt;&lt;P&gt;erv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jul 2010 14:16:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-write-data-on-a-remote-SQL-Server-db-with-ADO-object/m-p/222035#M503053</guid>
      <dc:creator />
      <dc:date>2010-07-13T14:16:06Z</dc:date>
    </item>
    <item>
      <title>Trying to write data on a remote SQL Server db with ADO object and OLEDB</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-write-data-on-a-remote-SQL-Server-db-with-ADO-object/m-p/222036#M503054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Only to say you that in the script module I connect succesfully with the remote DB via OLEDB driver.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jul 2010 14:18:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-write-data-on-a-remote-SQL-Server-db-with-ADO-object/m-p/222036#M503054</guid>
      <dc:creator />
      <dc:date>2010-07-13T14:18:57Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Trying to write data on a remote SQL Server db with ADO object and OLEDB</title>
      <link>https://community.qlik.com/t5/QlikView/Trying-to-write-data-on-a-remote-SQL-Server-db-with-ADO-object/m-p/222037#M503055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you got a little error in your connection string. The "UserId" must be typed with a blank to look "User Id"&lt;/P&gt;&lt;P&gt;This line should work for you:&lt;/P&gt;&lt;P&gt;url = "Provider=sqloledb;Data Source=server_name;Initial Catalog=db_name;User Id=xxxx;Password=xxxx"&lt;/P&gt;&lt;P&gt;Helmut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 14:48:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trying-to-write-data-on-a-remote-SQL-Server-db-with-ADO-object/m-p/222037#M503055</guid>
      <dc:creator />
      <dc:date>2010-07-28T14:48:17Z</dc:date>
    </item>
  </channel>
</rss>

