Re: Recordset to XML and back
From: Ivan Debono (ivanmdeb_at_hotmail.com)
Date: 10/26/04
- Previous message: Ivan Debono: "Re: ADO Stream Error"
- In reply to: Val Mazur: "Re: Recordset to XML and back"
- Messages sorted by: [ date ] [ thread ]
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
> >
> >
>
>
- Previous message: Ivan Debono: "Re: ADO Stream Error"
- In reply to: Val Mazur: "Re: Recordset to XML and back"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|