Share this Page URL

Chapter 16. Working with XML Data in Acc... > Importing an XML Document into Acces... - Pg. 570

Working with XML Data in Access 570 Importing an XML Document into Access One of the more powerful aspects of a relational database like Access is its ability to serve as a central data repository. XML documents are portable and lightweight datastores that are useful for capturing and storing small amounts of data from the Web but are not robust enough for storing, retrieving, indexing, and presenting data from thousands of records. As in the last scenario pre- sented in the preceding section, there are situations in which you might want to use XML to capture data and then use Access to store that data. Access has a powerful XML import feature that makes this very easy. To demonstrate this feature, let's create a very simple XML document and import it into Access. Create an XML document 1. 2. Open Notepad. Create a simple XML header by typing the following at the top of a new document: <?xml version="1.0" encoding="UTF-8"?> <dataroot xmlns:xsi=""> 3. Create two records in your XML document, as follows: <Table1> <Greeting>Hello</Greeting> <Noun>World</Noun> <Number>1</Number> </Table1> <Table1> <Greeting>Goodbye</Greeting> <Noun>Universe</Noun> <Number>2</Number> </Table1>