Re: ExportXML
- From: lyle <lyle.fairfield@xxxxxxxxx>
- Date: Fri, 29 Feb 2008 08:04:40 -0800 (PST)
On Feb 29, 10:14 am, eidosabi <eidos...@xxxxxxxxx> wrote:
This is a repost from a couple of days ago. I didn't get any
responses, and am really hitting my head on the wall with this. Even
knowing that it is a complete impossibility would be welcome news, if
only so I can stop hitting my head. :-)
I've got an Access 2003 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:
- □ books
--- □ book_author
----- [Lookup Data]
------- □ authors
--------- □ author_institution
----------- [Lookup Data]
------------- □ 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-
grandchildren-greatgrandchildren...
node relationships all the way down a tree during an xml export?
Thanks in advance!
-d
This is relatively easy to achieve, (but not using the methods you
descirbe) but is it what you want? It's Northinds 2007's Employees
Table.
BTW: I'm sure Nancy said, "Just say No to LookUp Tables!"
---------------
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly'>
<s:AttributeType name='ID' rs:number='1' rs:maydefer='true'
rs:writeunknown='true'>
<s:datatype dt:type='int' dt:maxLength='4' rs:precision='10'
rs:fixedlength='true'/>
</s:AttributeType>
<s:AttributeType name='Company' rs:number='2' rs:nullable='true'
rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c2' rs:name='Last Name' rs:number='3'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c3' rs:name='First Name' rs:number='4'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c4' rs:name='E-mail Address' rs:number='5'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c5' rs:name='Job Title' rs:number='6'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c6' rs:name='Business Phone' rs:number='7'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='25'/>
</s:AttributeType>
<s:AttributeType name='c7' rs:name='Home Phone' rs:number='8'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='25'/>
</s:AttributeType>
<s:AttributeType name='c8' rs:name='Mobile Phone' rs:number='9'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='25'/>
</s:AttributeType>
<s:AttributeType name='c9' rs:name='Fax Number' rs:number='10'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='25'/>
</s:AttributeType>
<s:AttributeType name='Address' rs:number='11' rs:nullable='true'
rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='536870910'
rs:long='true'/>
</s:AttributeType>
<s:AttributeType name='City' rs:number='12' rs:nullable='true'
rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c12' rs:name='State/Province' rs:number='13'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c13' rs:name='ZIP/Postal Code' rs:number='14'
rs:nullable='true' rs:maydefer='true'
rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='15'/>
</s:AttributeType>
<s:AttributeType name='c14' rs:name='Country/Region' rs:number='15'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c15' rs:name='Web Page' rs:number='16'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='536870910'
rs:long='true'/>
</s:AttributeType>
<s:AttributeType name='Notes' rs:number='17' rs:nullable='true'
rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='536870910'
rs:long='true'/>
</s:AttributeType>
<s:AttributeType name='Attachments' rs:number='18'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='536870910'
rs:long='true'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
<z:row ID='1' Company='Northwind Traders' c2='Freehafer' c3='Nancy'
c4='nancy@xxxxxxxxxxxxxxxxxxxx' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 1st Avenue' City='Seattle' c12='WA' c13='99999'
c14='USA' c15='#http://northwindtraders.com#' Attachments=''/>
<z:row ID='2' Company='Northwind Traders' c2='Cencini' c3='Andrew'
c4='andrew@xxxxxxxxxxxxxxxxxxxx' c5='Vice President, Sales'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 2nd Avenue' City='Bellevue' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Joined the company as a sales
representative, was promoted to sales manager and was then named vice
president of sales.'
Attachments=''/>
<z:row ID='3' Company='Northwind Traders' c2='Kotas' c3='Jan'
c4='jan@xxxxxxxxxxxxxxxxxxxx' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 3rd Avenue' City='Redmond' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Was hired as a sales associate and was
promoted to sales representative.'
Attachments=''/>
<z:row ID='4' Company='Northwind Traders' c2='Sergienko' c3='Mariya'
c4='mariya@xxxxxxxxxxxxxxxxxxxx' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 4th Avenue' City='Kirkland' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Attachments=''/>
<z:row ID='5' Company='Northwind Traders' c2='Thorpe' c3='Steven'
c4='steven@xxxxxxxxxxxxxxxxxxxx' c5='Sales Manager'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 5th Avenue' City='Seattle' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Joined the company as a sales
representative and was promoted to sales manager. Fluent in French.'
Attachments=''/>
<z:row ID='6' Company='Northwind Traders' c2='Neipper' c3='Michael'
c4='michael@xxxxxxxxxxxxxxxxxxxx' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 6th Avenue' City='Redmond' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Fluent in Japanese and can read and
write French, Portuguese, and Spanish.'
Attachments=''/>
<z:row ID='7' Company='Northwind Traders' c2='Zare' c3='Robert'
c4='robert@xxxxxxxxxxxxxxxxxxxx' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 7th Avenue' City='Seattle' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Attachments=''/>
<z:row ID='8' Company='Northwind Traders' c2='Giussani' c3='Laura'
c4='laura@xxxxxxxxxxxxxxxxxxxx' c5='Sales Coordinator'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 8th Avenue' City='Redmond' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Reads and writes French.'
Attachments=''/>
<z:row ID='9' Company='Northwind Traders' c2='Hellung-Larsen'
c3='Anne' c4='anne@xxxxxxxxxxxxxxxxxxxx' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 9th Avenue' City='Seattle' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Fluent in French and German.'
Attachments=''/>
</rs:data>
</xml>
.
- References:
- ExportXML
- From: eidosabi
- ExportXML
- Prev by Date: ExportXML
- Next by Date: Re: File > Close
- Previous by thread: ExportXML
- Next by thread: Saving Form Criteria
- Index(es):
Relevant Pages
|