2 Replies Latest reply: Jun 13, 2012 9:26 AM by Mirco Andreon RSS

    Empty ErrorMessage from DynamicUpdateCommand

    Mirco Andreon

      Hi, I'm using DynamicUpdateCommand this way:

      sub setFieldCHOOSE(value, table)
        'loop on table of choosen rows
        dim tipo, numero, carico
        set choosen = ActiveDocument.GetSheetObject(table)
        for i = 1 to choosen.GetRowCount-1 'skip header
          dim x
          tipo   = choosen.GetCell(x,0).Text
          numero = choosen.GetCell(x,1).Text
          carico = choosen.GetCell(x,2).Text
          'set value for this row
          dim stmt
          stmt = "UPDATE * SET CHOOSE = '" & value & "' WHERE TIPDOC='" & tipo & "' and NUMORD=" & numero & " and NUMCAR='" & carico & "' "
          set result = ActiveDocument.DynamicUpdateCommand(stmt)
           if result = false then
            MsgBox "Error with DynamicUpdateCommand. " & result.ErrorMessage
          end if  
        next
      end sub
      

      The problem is result is always false but result.ErrorMessage is always empty... so I get to know there is an error, but I don't know which error...

      Thanks for your help.