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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import XML in Access and assign a primary key

Status
Not open for further replies.

IlseDC

Programmer
Mar 24, 2003
49
BE
I want to import an XML file in Microsoft Access 2003.
When I do the import I get several tables.
Is there a possibility to use an XML element as primary key and use this same XML element as part of a key in a second table?

Example:

<Items>
<Item>
<Code>ID1</Code>
<Description>Item 1</Description>
<SubItems>
<SubItem>
<Code>SubA</Code>
<Description>Item A</Description>
</SubItem>
<SubItem>
<Code>SubB</Code>
<Description>Item B</Description>
</SubItem>
</SubItems>
</Item>
<Item>
<Code>ID2</Code>
<Description>Item 2</Description>
<SubItems>
<SubItem>
<Code>SubC</Code>
<Description>Item C</Description>
</SubItem>
</SubItems>
</Item>
</Items>

In Access I would like to have 2 tables:

Table 1 with "Code" as primary key
ID1 Item 1
ID2 Item 2

Table 2 with 2 fields as primary key
ID1 SubA Item A
ID1 SubB Item B
ID2 SubC Item C

Is this possible?

Thanks.
Ilse


 
Have tried to build this structure in an access database and then export the tables as XML to see what should be in the xml? (you may have xsd embedded elements)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top