exportxml with multiple relationships -
02-27-2008
, 02:30 AM
I've got an Access db that has many different relationships between
tables, for example, books <-> book_author <-> authors <->
author_institution <-> institutions. If I do an export xml from the
toolbar, there is an option to choose which data to export, for
example:
- $B""(B books
--- $B""(B book_author
----- [Lookup Data]
------- $B""(B authors
--------- $B""(B author_institution
----------- [Lookup Data]
------------- $B""(B institutions
Regardless of whether I export this way or via ExportXML in a VB
module, I get all the data, but I loose the node structure at certain
points. After trying everything I could think of, or find on the web,
I went back and examined the manual/toolbar option and noticed that
the relationships that fail to be maintained during the automated
process have a "[Lookup Data]" node between the parent and child node
(in the example above, between the book_author and author tables). So
I end up with something like:
<books>
<book_id>1</book_id>
<title>Run Rhonda Run</title>
<book_author>
<book_id>1</book_id>
<author_id>1</author_id>
</book_author>
<book_author>
<book_id>1</book_id>
<author_id>2</author_id>
</book_author>
</books>
<books>...more books...</books>
<authors>
<author_id>1</author_id>
<name>Rhonda Roads</name>
<author_instutute>
<author_id>1</author_id>
<institution_id>1</institution_id>
</author_institution>
</authors>
<authors>
<author_id>2</author_id>
<name>Robby Roads</name>
<author_instutute>
<author_id>1</author_id>
<institution_id>1</institution_id>
</author_institution>
</authors>
<authors>...more authors...</authors>
<instututions>
<institution_id>1</institution>
<name>Lincoln Elementary</name>
</institutions>
<institutions>...more institutions...</institutions>
I tried mucking around with relationships, but I'm always give the
same export options, regardless of table relationship definitions.
Does anybody have any suggestions on how to maintain the parent-child
node relationships all the way down a tree during an xml export?
Thanks in advance!
-d |