ACC2002: When You Change the XML Location from Embedded to Data File, the Embedded XML Remains Part of the Data Access Page

This article was previously published under Q281895
This article has been archived. It is offered "as is" and will no longer be updated.
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

By using the new properties of the data source control, you can bind a data access page to XML data that is embedded within the data access page or in a separate XML file. Embedded XML is also known as a data island. If you bind the page to an XML data island and subsequently bind the page to a separate file, the data island remains part of the page.
This behavior is by design. This functionality enables you to switch between two separate XML data sources very quickly.

Steps to Reproduce the Behavior

  1. Open the Northwind Sample database, and then create a new data access page in Design View.
  2. In the field list, expand the Customers table.
  3. Add the CustomerID, CompanyName, and ContactName fields from the Customers table to the page.
  4. Right-click the Header: Customers section, and then click Page Properties.
  5. Click the Data tab, and then change the UseXMLData property to True.
  6. Save the data access page.
  7. Press CTRL+G to open the Immediate Window.
  8. Type the following code in the Immediate Window, and then press ENTER:
    This code creates XML embedded within the page and binds the page to this XML. You can view the embedded XML in the browser by clicking Source on the View menu in Microsoft Internet Explorer.
  9. Return to the data access page in Design View.
  10. Change the XMLLocation property to dscXMLDataFile.
  11. Change the XMLDataTarget property to C:\[PageName]_Data.xml where PageName is the name of your data access page.
  12. Repeat steps 7 and 8. This binds the page to the XML file that you specified in step 11. Note that if you view the source for the page, the embedded XML is still present.

Article ID: 281895 - Last Review: 10/21/2013 04:50:10 - Revision: 3.1

Microsoft Access 2002 Standard Edition

  • kbnosurvey kbarchive kbdap kbprb KB281895