Wayne A Sobers 5.May.11 06:18 PM a Web browser LC LSXLC LSX - All ReleasesWindows
LCConnection insert returns count of 1, but no document is created in the target DB.
Our Service support system can only provide the record key for transactions that occur in its database tables.
I am using that key to select to an LCFieldList from the source DB, Fetching the data and using mapped LCFieldLists to update or insert the related FieldList into the target Notes DB.
The Fetch works, and I can see the information in the FieldLists, but the update fails and although the insert returns 1, there is no corresponding document created in the Notes database.
The specific problem is that although my counter records 113 inserts, there are only 26 documents added to the target DB.
The target view has the first two columns sorted ascending on the appropriate key fields.
Here is the key function:
'------------------------------------------------------------
Function Execute(operation As String) As String 'operation = D or U, returns "result" variable
Dim result As String
'
result = "NONE"
On Error GoTo processError
'
If operation = "D" Then
rcount = lconNotes.Remove(tgt_key_flds)
result = "DELETE"
Else
rcount = lconODBC.Select( src_key_flds, 1, Nothing)
'
rcount = lconODBC.Fetch(src_flds)
If rcount = 1 Then
If operation = "U" Then
Call convert_fields
If lconNotes.Update(tgt_flds,1,1) = 0 Then
If lconNotes.Insert(tgt_flds,1,1) = 0 Then
Error 1000, "neither update nor insert completed ok..."
Else
result = "INSERT"
End If
Else
result = "UPDATE"
End If
Else
Error 1000, "Unknown Operation ["+operation+"]"
End If
End If
End If
ExitFunction:
Me.Execute = result
Exit Function
processError:
Dim errMsg As String
If (lcSession.Status <> LCSUCCESS) Then
errMsg = "(LEI Error) " & lcSession.GetStatusText
lcSession.ClearStatus
Else
errMsg = Error$
End If
Print "Error on line " & Erl & ": " & errMsg
If lconODBC.IsConnected Then lconODBC.Disconnect
If lconNotes.IsConnected Then lconNotes.Disconnect
result = "ERROR"
Resume ExitFunction
End Function
'------------------------------------------------------------
LCConnection for the Notes DB is set from a profile document, MapByName = true and updateviews=true.
I've loaded the "uninserted" records into a spreadsheet along with the "inserted" records. The key values are present and I can see no problems with the other data fields.