Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to read xml from the database.

Status
Not open for further replies.

Transcend

Programmer
Sep 29, 2002
858
AU
Hi guys, i'm fairly stuck on this one!

I've been looking at MSXML2 in vb 6 to try and solve this one but haven't gotten very far so far!
Basically I am reading a recordset in from the database, and one of the fields is long text, that looks something like this:

<Parameters>
<Parameter>
<Name>Start</Name>
<Type>DateTime</Type>
</Parameter>
<Parameter>
<Name>End</Name>
<Type>DateTime</Type>
<Prompt>Last Date</Type>
</Parameter>

All i want to do is parse the XML and create a collection of 'parameters'.
I have created the classes and collections that i need, only thing now is how to I parse the XML and get the values out??

I'm really stuck, any help is appreciated.

Transcend
[gorgeous]
 
Sorry that should have been

<Parameters>
<Parameter>
<Name>Start</Name>
<Type>DateTime</Type>
</Parameter>
<Parameter>
<Name>End</Name>
<Type>DateTime</Type>
<Prompt>Last Date</Type>
</Parameter>
</Parameters>

Transcend
[gorgeous]
 
Ok finally figured it out! I needed to use the LoadXML method rather than the Load method.

Dim xmldoc As DOMDocument
Dim x As IXMLDOMNode
Dim y As IXMLDOMNode
Dim i As Integer


Set xmldoc = New DOMDocument
xmldoc.async = "false"
xmldoc.loadXML (Text1.Text)


Transcend
[gorgeous]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top