Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Hi,
try this,
in stmt =
"UPDATE * SET CHOOSE = '" & value & "' WHERE TIPDOC='" & tipo & "' and NUMORD= '" & numero & "' and
NUMCAR='" & carico & "' "
Hope it helps
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.