ACC2002: Data Access Page That Contains Embedded XML May Open Slowly (283203)



The information in this article applies to:

  • Microsoft Access 2002

This article was previously published under Q283203
Moderate: Requires basic macro, coding, and interoperability skills.

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

SYMPTOMS

In Access 2002, you can bind a data access page to XML embedded in the page or to an external XML file. Embedded XML is also referred to as an XML data island. If you open a page that is bound to a large XML data island, it may take a while for the page to open.

RESOLUTION

Instead of binding the data access page to an XML data island, use an external XML file to bind the page to. In addition, you may need to remove the XML data island from the page. To do so, follow these steps:
  1. Start Access 2002, and then open your data access page in Design view.
  2. Right-click the page in Design view, and then click Page Properties on the shortcut menu.
  3. In the property sheet, click the Data tab.
  4. Change the XMLLocation property to dscXMLDataFile.
  5. Verify that the UseXMLData property is set to True.
  6. In the XMLDataTarget property, type the name of a local XML file to save to, for example, MyXMLData.xml. If you do not enter a full path in this property, the XML file will be saved to the same folder as the page.
  7. On the Tools menu, point to Macro, and then click Visual Basic Editor.
  8. If the Immediate window is not visible, on the View menu, click Immediate Window.
  9. To remove the existing XML data island from the page, type the following code in the Immediate window, and then press ENTER:
    DataAccessPages(0).Document.all.DSCXMLData.removeNode
  10. To create the file specified in XMLDataTarget property and to bind the page, type the following code in the Immediate window, and then press ENTER:
    DataAccessPages(0).MSODSC.ExportXML
  11. Save the page, and then close the Visual Basic Editor.
  12. Open the page in Page view in Access. The page should open more quickly.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.

  1. Open the sample database Northwind.mdb or the sample project NorthwindCS.adp.
  2. In the Database window, click Pages under Objects, and then click New.
  3. In the New Data Access Page dialog box, click AutoPage: Columnar, click Invoices in the Choose the table or query where the object's data comes from box, and then click OK.
  4. On the View menu, click Design View.
  5. Right-click the page in Design view, and then click Page Properties on the shortcut menu.
  6. In the property sheet, click the Data tab.
  7. Change the UseXMLData property to True. Verify that the XMLLocation property is set to dscXMLEmbedded.
  8. On the Tools menu, point to Macro, and then click Visual Basic Editor.
  9. If the Immediate window is not visible, on the View menu, click Immediate Window.
  10. Type the following code in the Immediate window, and then press ENTER:
    DataAccessPages(0).MSODSC.ExportXML
  11. Save the page, and then close the Visual Basic Editor.
  12. Open the page in Page view in Access.
Note that it takes a while to open the page.

Modification Type:MinorLast Reviewed:9/27/2006
Keywords:kbbug kbDAP kbfix KB283203