Results 1 to 2 of 2
  1. #1
    Bruinsmm is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    1

    Access 2010: Export XML

    Hello,

    I have 2 tables in Access (patient and accident). I want to export the data from the 2 tables to XML.
    Access output the following XML code:

    <?xml version="1.0" encoding="UTF-8"?>
    <dataroot xmlnsd="urn:schemas-microsoft-comfficedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="case.xsd" generated="2012-07-22T17:08:15">
    <case>
    <patientcode>00002</patientcode>
    <patient>
    <patientcode>00002</patientcode>
    <age>53</age>
    <gender>1</gender>
    <asa>1</asa>
    </patient>
    </case>
    <accident>
    <patientcode>00002</patientcode>
    <datetime>2002-09-06T00:00:00</datetime>
    <cause>1</cause>
    <trauma>1</trauma>
    <type>3</type>
    <typeComment>trug Fahrradhelm</typeComment>
    </accident>
    </dataroot>


    XML from Access looks different, from the XML code from the client (see code below).


    Is there any way to custom the output XML code? Is this possible with the XSD template or must i have write a VBA code the produce the custom XML code ?



    <patientCode>00111</patientCode>
    -<masterData>
    -<patient>
    <gender>1</gender>
    <age>28</age>
    </patient>
    -<accident>
    -<dateTime>
    <date>2011-01-01</date>
    <time>08:30:00</time>
    </dateTime>
    <cause>1</cause>
    <type>1</type>
    </accident>



    with regards
    Martin Bruinsma

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    I don't think the export wizard allows that customization. http://office.microsoft.com/en-us/ac...001034561.aspx

    You can use VBA procedure to write to a text file. http://www.tek-tips.com/faqs.cfm?fid=3767 Just change the file extension to xml.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-14-2012, 01:09 PM
  2. Export to Excel from Pivot Table in Access 2010
    By nicon2k in forum Import/Export Data
    Replies: 0
    Last Post: 04-10-2012, 07:02 AM
  3. Replies: 4
    Last Post: 07-26-2011, 12:33 AM
  4. Replies: 0
    Last Post: 12-03-2010, 04:02 PM
  5. Export 2 Queries to Same Workbook in Access 2010
    By Mikey in forum Import/Export Data
    Replies: 2
    Last Post: 08-23-2010, 05:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums