Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to import xml file into access as one table??

Status
Not open for further replies.

handsrfull

Technical User
Feb 22, 2008
8
US
Is it possible to import an xml file into acces and not have access break it up into multiple tables? I would like it to place it into one table like it does when you import it into excel.

Any insight?
 
Kind of hard to know without seeing the xml data however XML is very Simple:

The import process in Access works best if there is a schema definition included but it doesn't require one

There are 2 main components to an xml file;
1) Elements
<Element>data</Element>
2) Attributes
<Element> Attribute1=data Attribute2=data </Element>

only Elements are imported

There can only be one root element in a file

<Root>
<Table1>
<Field1>data</Field1>
<Field2>data</Field2>
</Table1>

<Table1>
<Field1>data</Field1>
</Table1>

<Table2>
<Field1>data</Field1>
<Field2>data</Field2>
</Table2>

<Table2>
<Field1>data</Field1>
<Field3>data</Field3>
</Table2>
</Root>

This example should create two tables each with 2 records ... one should have 2 fields the other should have 3
 
How are ya handsrfull . ..

Have a good look at the [blue]Application.ImportXML[/blue] method.

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top