Lookup Data From an XML Document

Category:
ASP, HTML and XML
Type:
Snippets
Difficulty:
Beginning

Author: Andrew Park

Version Compatibility: Visual Basic 6

More information:
This is an exmaple of how you can search the xml document and find the element of data you want from the xml document. A reference to Microsoft's XML object is required.

To make the example work, save the XML at the bottom to a file called C:\testxml.xml. Then call the function like this:

MsgBox GetID(1, "true", "commercial")
Of course, you should use this as a learning example to develop your own lookups because the data in this particular example won't apply in your case.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: