I have an Lotusscript agent that updates an informix table. The agent looks to see if a particular record already exists on the table. If so, it updates it with new info. If it doesn’t exist, it adds a record with all the pertinent info. Problem is that result.AddRow doesn’t always work. It will go through and add 6 or 7 rows to the table, then the next time I do a Result.AddRow, it fails. So, consequently, the result.SetValue is resulting in an NSD, crashing my client. I can do error handling to code around it, but why would it fail?? It works OK sometimes!
Here’s a snippet of my code:
Sub updateTable
qry.SQL = "SELECT * FROM " & TBL_KNOWN & " WHERE DATE_ID=" & dts(z) & "'"
If Not res.execute Then
Print "Error: " & res.GetExtendedErrorMessage,,res.GetErrorMessage
Exit Sub
End If
For w = 0 To 17
res.FirstRow
If res.LocateRow(EX_FLD_CAT_KS,dailyValues(w,0)) Then
'do stuff
Else
'row not found, add it
If res.AddRow Then
Print "Row added OK"
Else
Print "Row not added"
End If
Call res.SetValue(EX_FLD_DATE_KS,dts(z))
'The above is resulting in an NSD when the res.AddRow fails.
'Why is res.AddRow failing?
End If
Next
End Sub
Or alternatively, is there some way I can add code to tell me the reason for the failure?
Any help is greatly appreciated!