Results 1 to 5 of 5

Thread: xml and ado

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Barcelona
    Posts
    26

    Question xml and ado

    It is possible to load a node of a xmlDocument in an adodb recordset?

  2. #2
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    yes it is possible. create a disconnected recordset and use the open method, specifying the path to the xml file. The fragment must be in a valid ado xml schema. To find out what the valid schema is, connect to a database and select something. Then execute the save method of the recordset object and specify persistxml with the filepath. This should generate an xml file. Open the file and have a look at the schema. That is the format you have to use with the recordset object.

    Play around with editing records and then saving the xml file. This will show how they handle persistent data and updates.

    Unfortunately, I do not have time to type out an example at the moment.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Barcelona
    Posts
    26

    Question xml and ado recordsets

    Thanks for your response. It is possible I don't understand you exactly. If I use the open method:
    recordset.Open path\file.xml, adoConnection
    I load in the recordset all the xml file. Imagine I have a xml file like this:
    <?xml version="1.0"?>
    <extract>
    <title1>

    </title1>
    <title2>

    </title2>
    <lines>
    <line>

    </line>
    <line>

    </line>
    <line>

    </line>
    </lines>
    </extract>

    ..and I want to load into a recordset only the ‘lines’ node. How can I do it?

  4. #4
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Three Anchor Bay, Cape Town, South Africa
    Posts
    769
    I have not tried this, but I presume that you would have to wrap the node in the ado schema. I don't think the format you have above would work either, but it's worth a try.

    Use xslt to get the data into the correct format.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Location
    Barcelona
    Posts
    26

    Post xml and ado recordsets

    I have solved the problem, perhaps not in better way.
    I put in a xmlNode variable the node I want treat. Then with a new xmlDocument variable I add the node and save the xmlDocument i a new xml file. Finally I open a recordset when the source parameter is the new xml file (that only contents the node I want).
    thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width