Recently, a colleague complained that one of her clients needed for her to
prepare a lengthy report to distribute to personnel outside the home office. The
routine was laborious at best, and she was desperate for an easier solution. I
mentioned that extensible markup language (XML) might be a good alternative
to her work-intensive method. Within just a few days, she produced an
easy-to-implement solution and was busy reviewing other problems for possible
XML-based remedies. The easy export process was her solution for getting the
report out of the office.In Access 2002, you can export Access data in XML format or import XML data into your Access database using the Access interface or Visual Basic for Applications (VBA). When you export data, Access produces several files, and you’ll need to understand each one’s purpose so that you can take an Access report to the Web.
The upshot of this solution is that you can share an XML file with almost any application running on any operating system. Realistically, it can be difficult to land just the right combination of XML options. Fortunately, once you do hit it right, it works great.
In this article, I’ll show you how to quickly create Web-ready files from Access reports using XML files that pass along the report’s data, structure, and formatting.
XML and Access
You can import XML files into Access or you can export Access objects as XML files. In this article, I’ll export Access reports to Web-ready HTM files using the XML export feature. In doing so, I’ll export the following file types:
- XML: The actual data presented in what are known as element blocks that reference the original table fields
- XSL: A special stylesheet that is applied to the XML file in order to format the data
- XSD: Contains data type and constraint information
- HTM: A Web-ready version of your Access object
You may end up using the actual XML files, but in this article, I’ll just view the resulting HTM file.
An interface example
Now, let’s use the Access interface to quickly create a Web-enabled report by exporting a report as XML. For this example, I’ll export the Catalogs report in the sample database, Northwind, that comes with Access:
- Open the Northwind Sample Database, and select the Catalogs report in the Database window.
- Choose Export from the File menu.
- In the Export dialog box, specify the appropriate folder (I’ll just work with the default), name the file “Catalog,” select XML Documents (*.XML) from the Save As Type control, and then click Export.
- In the next dialog box, specify both the Data (XML) and Schema Of The Data options, as shown in Figure A, and then click OK to generate the following files: Catalog.xml, Catalog.xsl, Catalog.xsd, and Catalog.htm.
| Figure A |
![]() |
| Select both enabled export options. |
Using Windows Explorer, locate Catalog.xml and then open it in your browser. (You may have to use the Open With option if you have a Web-authoring tool that usurps the XML file association.) Figure B shows Catalog.xml in Internet Explorer. (Netscape doesn’t support XML.)
It isn’t exactly Web ready, is it? As I mentioned earlier, it’s just a bunch of tags and data. However, the export also produced Catalog.htm, which is a Web-ready file. Open it now and take a peek if you like. It should look very similar to the original Access report, as displayed in Access.
| Figure B |
![]() |
| The XML file isn’t exactly Web ready. |





















There are currently no comments for this post.