Can't Update XML Recordset



We return an updated XML recordset from a web service call. That part
works great if reading the data. What I want to do is get the results,
update some of the field's data, and use that information to call
another web service method. When the code reaches the line
"objRs(1).Value = "ETC"" in the AltMethod procedure we are getting the
following error: "Multi-step operation generated errors. Check each
status value." What are we doing wrong?

This a VB6.0 app. I made some noted mods below to protect the innocent
=)

'********************************************************

Private Sub AltMethod()
Dim objRs As New ADODB.Recordset
Dim objCRS As Object
Dim str As String

str = '** XML Recordset from Web Service **'

' Create Read/Write Recordset
objRs.CursorLocation = adUseClient
objRs.Open GetADOStream(str), , adOpenKeyset, adLockOptimistic,
adCmdFile

While Not objRs.EOF
Text1.Text = Text1.Text & objRs("debtorNo") & vbCrLf &
objRs.RecordCount
objRs.MoveNext
Wend

'MsgBox CStr(objRs.Supports(adUpdate))

objRs.MoveFirst
objRs(1).Value = "ETC" ''' This is where the error occurs!!!
objRs.Update

'objRs.Save , adPersistXML

'Text1.Text = CStr(objRsXML)

objRs.Close
If Not objCRS Is Nothing Then Set objCRS = Nothing
If Not objRs Is Nothing Then Set objRs = Nothing


End Sub

Private Function GetADOStream(strXMLResponse)
Dim objStm As New ADODB.Stream

' Create the ADO stream object
' Set objStm = CreateObject("ADODB.Stream")

' Convert the XML into something an ADO recordset object can read
objStm.Open
objStm.WriteText strXMLResponse
objStm.SetEOS
objStm.Position = 0

' Return recordset XML stream
Set GetADOStream = objStm

Set objStm = Nothing

End Function

Private Function GetXMLResponse(strRequest, strAction)
Dim strResponse As String
Dim objXML As Object

' Load the MSXML object and send to the server
Set objXML = CreateObject("Msxml2.XMLHTTP.4.0")

objXML.Open "POST", strServer & "/" & strAction, False
objXML.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
objXML.setRequestHeader "Content-Length", CStr(Len(strRequest))
objXML.send strRequest ' Commented out for testing...

' Store the server response
strResponse = objXML.responseXML.xml ' Commented out for testing...

' Set objXML to nothing
If Not objXML Is Nothing Then Set objXML = Nothing

' Return the XML string
GetXMLResponse = strResponse

End Function

.



Relevant Pages

  • Re: How to Programmatically Export as XML & SXL
    ... Unfortunately, I've had precious little to do with XML in Access, so I'm ... you use the ADO Recordset object's Save ... >>Dim rs As ADODB.Recordset ... >>Dim strADTGFile As String ...
    (microsoft.public.access.externaldata)
  • Re: Copy Recordset
    ... Dim xml As MSXML2.DOMDocument, ... If what you need are two copies of the same recordset that are independant ... Set rst = New ADODB.Recordset ...
    (microsoft.public.vb.database.ado)
  • Re: adodb.recordset.save and back
    ... persisted XML file back into recordset, ... Dim Rs as New ADODB.Recordset ... and when you reconnect it to the database you get the error ...
    (microsoft.public.data.ado)
  • Re: For XML -> ADO Recordset
    ... The xml you are getting is not a persisted recordset it is simply pure xml ... Dim oCmd As Command ... Dim rs As New ADODB.Recordset ...
    (microsoft.public.sqlserver.xml)
  • Re: access 2003
    ... Dim ctl As Control ... Dim rs As Recordset ... This sets the query definitions for choosing data to create an invoice using ... Event on combo box: Private Sub ChooseCust_AfterUpdate ...
    (microsoft.public.access.conversion)