-
I re-formatted your code using the VBA tag so I could see it better.
[vba]Public Function Runner()
fPullMeta "IP", "20000", 13
End Function[/vba]
[vba]Public Sub fPullMeta(sIP As String, sPort As String, sSource As String)
'This function takes in an ip,port,a source numeric, and a volume numeric.
'It queries idol and places the metadata into the DOCUMENT table.
Dim xmldoc As DOMDocument
Set xmldoc = New DOMDocument
xmldoc.async = False
xmldoc.validateOnParse = False
Dim Query As String
Query = "http://" & sIP & ":" & sPort & _
"/action=query&anylanguage=true&print=fieldsprintfields=UUID," & _
"AUN_PRODUCTION_VOLUME_NUMERIC&DATABASEMATCH=" & _
sSource & "&fieldtext=EXISTS{}:AUN_PRODUCTION_VOLUME_NUMERIC&SORT=ALPHABETICAL:UU ID"
xmldoc.Load (Query)
ParseXML xmldoc
Next
End Sub[/vba]
[vba]Public Sub ParseXML(xmldoc As DOMDocument)
Dim doc As IXMLDOMNodeList
'Goes through the results of IDOL, looks for specific values, and copies those
'values into the IDOLRESULTS table.
Set doc = xmldoc.getElementsByTagName("DOCUMENT")
Dim entry, child As IXMLDOMNode
Dim children As Recordset
Set children = CurrentDb.OpenRecordset("IdolResults")
Dim UUID As String
Dim VolID As Long
VolID = 0
For Each entry In doc
For Each child In entry.childNodes
If (child.nodeName = "UUID") Then
UUID = child.Text
ElseIf (child.nodeName = "AUN_PRODUCTION_VOLUME_NUMERIC") Then
If child.Text > VolID Then
VolID = child.Text
End If
End If
children.AddNew
children(0) = UUID
children(1) = VolID
children.Update
Next
Next
children.Close
End Sub[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules