Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bluishjoe
Contributor III
Contributor III

Empty ErrorMessage from DynamicUpdateCommand

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.

2 Replies
MayilVahanan

Hi,

     try this,

     in stmt =

"UPDATE * SET CHOOSE = '" & value & "' WHERE TIPDOC='" & tipo & "' and NUMORD= '" & numero & "' and

NUMCAR='" & carico & "' "

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
bluishjoe
Contributor III
Contributor III
Author

Thanks but makes no difference. NUMORD is really an integer.

Anyway my main problem is that ErrorMessage is empty. I have to solve it and then I could face any SQL problem, current one included.