|Microsoft Office Access 2003
Microsoft Access 2002
In Access 2002 or later, you can output data to Extensible Markup Language (XML) by exporting to an XML document. You can also output schema files to specific the structure of the XML document as well as a style sheet to describe the presentation of your data.
Export a table, query, form, or report as XML
- In the Database window, click the name of the table, query, form, or report that you want to export, and then on the File menu, click File.
- In the Save as type box, click XML Documents (*.xml).
- Click the arrow to the right of the Save in box, and select the drive or folder to export to.
- In the File name box, enter a name for the file, and then click Export.
- In the Export XML dialog box, do one or more of the following:
- To export the data to an XML document, select Data (XML).
- To export the schema to an XML file, select Schema of the data.
- To format your table or query data by using an Extensible Style Language file, select Presentation of your data (XSL).
Note The Data check box must be selected for the Presentation of your data (XSL) drop-down box to be available.
- Click OK to export to the XML document.
Set advanced options for exporting XML files
- In the Export XML dialog box, click Advanced.
- Set options by doing one or more of the following:
Export data to XML
- Select the Data tab.
Note The Export data check box reflects the selections made in step 5.
- Enter a destination for the exported files in the Export location dialog box or use the Browse button. The path can be to a hard disk drive or a universal naming convention (UNC) path on a server.
- To select an encoding format other than the default, click the Encoding drop-down box and make a selection.
Export schema to XML
- Select the Schema tab.
Note The Export Schema check box shows the selection made in step 5.
- To include additional information on the underlying structure of the database, select the Include primary key and index information check box.
- To embed the schema directly into the XML data document, select the Embed schema in exported XML data document option.
To create a schema file which is separate from the data file, select the Create separate schema document option, and enter a valid destination for the file or use the default.
Present your data
- Select the Presentation tab.
Note The Export Presentation (HTML 4.0 Sample XSL) drop-down box shows the selection made in step 5.
- Do one of the following:
In order for images to appear correctly in an XML presentation, they must be located external to the XSL document which contains internal references to the files. Do one of the following:
- To run the exported file from a client machine, select the Client (HTML) option under the Run from selection. This option generates an HTML file on the client machine which contains scripting code to merge the presentation (XSL) file and the data (XML) file. This option has the advantage of indirectly referencing the presentation file from the HTML file instead of embedding the presentation information in the data. Therefore, either the data (XML) file or presentation (XSL) file can be changed without having to rerun the original document.
- To run the exported file from a server, select the Server (ASP) option under the Run from selection. This option generates an ASP file that merges the presentation (XSL) information with the data (XML) and sends the resulting HTML file to the client machine for display.
Enter a destination for the exported presentation file in the Export location dialog box, or use the Browse button. The destination path can be to a hard disk drive or a universal naming convention (UNC) path on a server.
- Select the Put images in option and the file location.
- Select the Don't include images option to exclude any document images from the XML version.