O'Reilly logo

XML Hacks by Michael Fitzgerald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Work with XML in Microsoft Access 2003

If you are a Microsoft Access user, you’ll be happy to know that you can export Access 2003 data as XML.

Microsoft Access 2003 is Office’s database application. You can create a table of data—an Access database—and label each field with a name you’d like to use as an XML element name. One way to get started is by importing an existing XML document into Access. Here’s how to do it.

Open Access, and then select File Get External Data Import. In the Import dialog box, make sure it says XML in the “Files of type” pull-down menu. Navigate to the working directory and click on the file time.xml. Then click Import. Not all information is preserved, but close.

You will then see the Import XML dialog box. Click on the Options button, and the dialog will appear as it does in Figure 2-14. You can choose to import the XML structure only (i.e., only the markup) or the structure with data (i.e., the markup and content). You can also choose to append the data to an existing table; i.e., a table with the same name as the original document (in this example, time). If you append the data, the content of the XML document is added to a record of the database file using the same fields that are created from the element names.

Import XML dialog box in Access 2003

Figure 2-14. Import XML dialog box in Access 2003

After you have imported the document, you should see a database table in the navigator ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required