Importing XML into MS Access 2003
(Page 1 of 4 )
This article is about importing an XML file into MS Access 2003. XML is the lingua franca of the Internet and is used extensively in how we communicate. There is hardly any area that is untouched by XML. It gets this power because information in most formats can be reduced to this one text-based format that can be transformed again into other, different formats. This really is extensibility at its best.
Introduction
MS Access has been around for a long time, and over time it has added support for importing and exporting its data into HTML when HTML was king. When the extensive use of XML appeared on the landscape, MS Access added importing and exporting features to its arsenal. According to product documentation, MS Access 2003 fully supports importing and exporting XML.
Unlike HTML which was display-centric, XML is data-centric. Its tags have no more meaning than you bestow upon them. XML called for more discipline than HTML coders were used to in creating their pages, but at a minimum required a "well formed" document. Developers also had to put into writing what their "tags" really meant, and how their tags related (XML schema) to their data (XML data). This was the difficult part, particularly at a time when standards were still fluid. The difficulty in importing arises because of the inherent relationship that must exist between these two parts.
Importing a simple XML file
The imported file
The example chosen is one from my previous articles, the webstudents.xml. The next paragraph shows the complete file. This meets the minimum requirement of a "well formed" XML document.
webstudents.xml<?xml version="1.0"?>
<wclass>
<!-- My students who attended my web programming class -->
<student id="1">
<name>Linda Jones</name>
<legacySkill>Access, VB5.0</legacySkill>
</student>
<student id="2">
<name>Adam Davidson</name>
<legacySkill>Cobol, MainFrame</legacySkill>
</student>
<student id="3">
<name>Charles Boyer</name>
<legacySkill>HTML, Photoshop</legacySkill>
</student>
<student id="4">
<name>Charles Mann</name>
<legacySkill>Cobol, MainFrame</legacySkill>
</student>
</wclass>
This document is also in the root folder of the local IIS, and browsing it brings up the display shown in the next picture. Since there are no error messages when it is browsed, it meets the minimum requirements. It has three student nodes whose "ids" are stored in attributes, and each student node has two child nodes with no attributes.

Next: Importing the file into MS Access 2003 >>
More Microsoft Access Articles
More By Jayaram Krishnaswamy