4 Replies Latest reply: Jul 22, 2014 6:46 AM by Ganesh Singh RSS

    Writeback Feature in Database

      I have created writeback report..but right back is not working for me..
      can you pls provide me simple example writeback in Databse.

       

       

      Thi is macro which i used in

       

      sub PullData

      dim sServer, sConn, oConn,oRS
      sServer="sqlservername"
      sConn="Provider=SQLOLEDB.1;Initial Catalog=ClientBISDb;Data Source=ibdsql4004,2431"
      Set oConn = CreateObject("ADODB.Connection")
      oConn.Open sConn, "Username", "Password"
      Set oRS =CreateObject("ADODB.Recordset")
      sSQL="Select name from qliktest"
      oRS.Open sSQL, oconn

      set Result = oRS

      While (Not Result.EOF)
      msgbox(Result.Fields(0).Value)
      SET Inputting = ActiveDocument.DynamicUpdateCommand ("INSERT INTO qliktest (F1) VALUES (" + Result.Fields(0).Value + ")")
      Result.MoveNext
      Wend

      end sub