Re: Recordset to XML and back

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ivan Debono (ivanmdeb_at_hotmail.com)
Date: 10/26/04

  • Next message: Gerard Troost: "Limitation of MS Access database."
    Date: Tue, 26 Oct 2004 09:32:48 +0200
    
    

    Let me tell you my approach.

    I persist a hierarchical disconnected recordset as xml. I open the xml and
    insert a <rs:insert> node, moving all <rs:data> nodes under the insert node
    and save the file again. Then I open the file into an empty recordset and
    persist this recordset to adtg (the only way to persist changes in a
    hierarchy).

    This is working fine, but the extra reading/writing to disk is quite
    time-consuming considering that I can have 1000s of hierarchies to export.

    Ivan

    "Val Mazur" <group51a@hotmail.com> schrieb im Newsbeitrag
    news:O80p0qwuEHA.1420@TK2MSFTNGP10.phx.gbl...
    > Hi Ivan,
    >
    > As soon as you keep same schema definition for the XML file as original
    ADO
    > XML was, then you should be able to load this XML back into recordset. But
    > to be able to update database, you would need to change status of the
    > records to inserted or updated, depending on what you need to do. I have
    an
    > example how to *switch* ADO recordset from one database to another one. It
    > could help you and if you need this example let me know by email and I
    will
    > send it to you
    >
    > --
    > Val Mazur
    > Microsoft MVP
    >
    >
    > "Ivan Debono" <ivanmdeb@hotmail.com> wrote in message
    > news:OI0Dl4MuEHA.2788@TK2MSFTNGP09.phx.gbl...
    > > Hi all,
    > >
    > > I'm persisting an ado hierarchical recordset to xml and cleaning it up.
    > > The end result looks something like this:
    > >
    > > <mytable>
    > > <record id = 1 name="A">
    > > <record_subtable id = 10 record_id = 1 name = "AA" />
    > > <record_subtable id = 11 record_id = 1 name = "BB" />
    > > </record>
    > > </mytable>
    > >
    > > I clean it up so that it's user readable, less overhead, etc...
    > >
    > > Now I need to get this xml back into a hierarchical recordset and update
    > > the database.
    > >
    > > Question: As the above xml is a trimmed down version of the actual xml
    > > persisted originally by ado, do I need to manually parse everything,
    match
    > > fields, update values, etc... or is there any easier way to do it??
    > >
    > > Thanks,
    > > Ivan
    > >
    > >
    >
    >


  • Next message: Gerard Troost: "Limitation of MS Access database."

    Relevant Pages

    • Re: XML Persistence scenario
      ... The XML would still need to match the data provider, ... rendered to XML as attributes when persisting, they have to make sence to ... >> The reason has to do with the recordset from which you originally ...
      (microsoft.public.data.ado)
    • Re: ADO 2.7: Multiple-step operation generated errors
      ... You could try persisting the recordset to XML and then reading the XML back ... You could also persist it to XML and modify the XML then load it back. ...
      (microsoft.public.data.ado)
    • Re: How to Programmatically Export as XML & SXL
      ... Unfortunately, I've had precious little to do with XML in Access, so I'm ... you use the ADO Recordset object's Save ... >>Dim rs As ADODB.Recordset ... >>Dim strADTGFile As String ...
      (microsoft.public.access.externaldata)
    • Re: MDAC Converting Dataset to XML
      ... I hadn't realised there was a later version of MDAC than the one we had ... recordset is fine, the code that does this is a mirror of the conversion to ... XML and for completeness I include a copy (albeit ... Can you reproduce the symptom by saving the first piece of xml to a file, ...
      (microsoft.public.data.ado)
    • Re: Database + dll
      ... You can include an XML or ADTG persisted Recordset with the ... XML can be compiled into a DLL as a resource, ... copied to a stream first anyway (not that the recordset would alter the ... It's a simple matter of creating a custom resource type from an XML file at ...
      (microsoft.public.vb.database.ado)