Link to home
Start Free TrialLog in
Avatar of posae
posae

asked on

Writing Dataset to XML in .Net and then Reading in VB6

Hello,
I have an application written in vb.net using VS 2008.  It creates a data set and then writes the data to an xml file using DATASET.DATATABLE.WriteXML("filename")

I need to read this xml file in VB6 to load into a datagrid and I am running into some issues.  in my VB6 app I simply have the following to open the xml file and check to see if it loads.  No Matter what I do, I keep getting an error when loading of "Invalid at the top of the Document"

Private Sub Form_Load()
    Dim oDom As New MSXML2.DOMDocument40
    Dim bOK As Boolean
   
    CommonDialog1.Filter = "*.xml|*.xml"
    CommonDialog1.ShowOpen
   
     If (CommonDialog1.FileName = "") Then Exit Sub
   
    bOK = oDom.loadXML(CommonDialog1.FileName)
   
    If Not bolResult Then MsgBox oDom.parseError.reason
    Exit Sub
End Sub


Here is the XML file contents:

<?xml version="1.0" standalone="yes"?>
<fhsrchResult xmlns="http://tempuri.org/fhsrchResults.xsd">
    <fhsrchResult>
        <document_name>surveillance update</document_name>
        <location>001 01 328</location>
        <type>CORR</type>
        <meta_id>3880</meta_id>
        <is_legal>YES</is_legal>
        <is_ime>YES</is_ime>
        <is_record>YES</is_record>
        <status xml:space="preserve">
        </status>
        <provider />
        <filename>001-surveillance update.pdf</filename>
        <created_date>2009-02-08T06:10:49-05:00</created_date>
    </fhsrchResult>
    <fhsrchResult>
        <document_name>HRG RPT  10-9-08</document_name>
        <location>001 01 328</location>
        <type>LEG</type>
        <meta_id>3313</meta_id>
        <is_legal>YES</is_legal>
        <is_ime>NO</is_ime>
        <is_record>NO</is_record>
        <status xml:space="preserve">
        </status>
        <provider />
        <filename>003-HRG RPT  10-9-08.pdf</filename>
        <date_of_service>2008-10-09T00:00:00-04:00</date_of_service>
        <created_date>2009-02-08T06:10:45-05:00</created_date>
    </fhsrchResult>
</fhsrchResult>

Any help would be greatly appreciated!
ASKER CERTIFIED SOLUTION
Avatar of Antagony1960
Antagony1960

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of posae
posae

ASKER

Wow...I guess I should have started off my post with "I don't know anything about programming..."

thanks a lot for your help!
Glad to have helped. :-)
Avatar of posae

ASKER

Ok...now that I have loaded the xml file, is there an easy way to just load the information into a record set?