V
Virgil
I wonder if someone can help me with what i need code wise in the ' HELP here
please
below.
I want to update EXISTING records from an xml source using the XML data.
Details are in the sample code below.
Many thanks in advance
Sub Read_XML_Data()
Dim rst As ADODB.Recordset
Dim stCon As String, stFile As String
Dim i As Long, j As Long
' This has row records which have the rows "NAME" in Column A
' then updates to other colums within the row
' NB: Only some of the row columns will be updated.
stFile = "C:\myupdates.xml"
stCon = "Provider=MSPersist;"
With rst
.CursorLocation = adUseClient
.Open stFile, stCon, adOpenStatic, adLockReadOnly, adCmdFile
Set .ActiveConnection = Nothing
End With
With ActiveSheet
' HELP here please
' Find the row with the same "NAME" as what is in the XML record
' code here
'Copy the data from the XML recordset for this "NAME" into the row
'.Range("... rst....
End With
'Closing the recordset.
rst.Close
'Release object from memory.
Set rst = Nothing
End Sub
XML
<row>
<name>fred</name>
<age>24</age>
<email>[email protected]</email>
</row>
....
please
below.
I want to update EXISTING records from an xml source using the XML data.
Details are in the sample code below.
Many thanks in advance
Sub Read_XML_Data()
Dim rst As ADODB.Recordset
Dim stCon As String, stFile As String
Dim i As Long, j As Long
' This has row records which have the rows "NAME" in Column A
' then updates to other colums within the row
' NB: Only some of the row columns will be updated.
stFile = "C:\myupdates.xml"
stCon = "Provider=MSPersist;"
With rst
.CursorLocation = adUseClient
.Open stFile, stCon, adOpenStatic, adLockReadOnly, adCmdFile
Set .ActiveConnection = Nothing
End With
With ActiveSheet
' HELP here please
' Find the row with the same "NAME" as what is in the XML record
' code here
'Copy the data from the XML recordset for this "NAME" into the row
'.Range("... rst....
End With
'Closing the recordset.
rst.Close
'Release object from memory.
Set rst = Nothing
End Sub
XML
<row>
<name>fred</name>
<age>24</age>
<email>[email protected]</email>
</row>
....