Microsoft KB Archive/286808

= You may receive a &quot;Microsoft Access Cannot Create Table&quot; error message when you try to import XML in Access 2002 =

Article ID: 286808

Article Last Modified on 8/19/2004

-

APPLIES TO


 * Microsoft Access 2002 Standard Edition

-



This article was previously published under Q286808



Moderate: Requires basic macro, coding, and interoperability skills.

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



SUMMARY
When you try to import XML, you may receive the following error message:

Microsoft Access cannot create table(s) using the information contained in the document(s) you are trying to import.

This article explains the possible causes of this error message.



MORE INFORMATION
In Access, you can import element-centric XML data from an XML data file. There are circumstances when Access cannot import data from the document that you are trying to import, and when this happens, you receive the error message that is mentioned in the &quot;Symptoms&quot; section of this article. Possible causes of this error are as follows.

The XML Is Not Well-Formed
Microsoft Access uses the Simple API for XML 2.0 (SAX) when importing XML data. If SAX determines that the XML is not well-formed, the error occurs. To import XML data into Access, it must be well-formed. To check if the XML is well-formed, you can open the document in Microsoft Internet Explorer 5 or later. If the document opens without an error, it is well-formed.

The XML Has Insufficient Information
In order to import XML, Access looks for a root element and at least one child element that is used as the table name. Although the following XML is well-formed, it does not contain enough information for Access to import it:

In this case, you have to modify the document to provide more information. Without an XML Schema (XSD) or a transform (XSLT), the general structure of an XML document imported into Access must be as follows:

test data hello world If you import this XML document into Access, it creates a table that is named tablename with two fields, field1 and field2, and two records.

You Are Using a Reserved Word
Using the example from the &quot;Insufficient Information&quot; section, if your tablename is one of the following words, you receive the error message that is mentioned in the &quot;Symptoms&quot; section:
 * dataroot
 * root
 * schema

In this case, change the rootnode or tablename to a name other than the words &quot;dataroot,&quot; &quot;root,&quot; or &quot;schema.&quot;

NOTE: If you use the word &quot;schema&quot; in place of the rootnode or the tablename, you first receive the following warning for each occurrence of the opening tag:

'''The document(s) you are importing contain XML Schema (XSD) information created outside Microsoft Access. XML Schema information created outside Microsoft Access is not supported. If you continue, Microsoft Access will only import the data, and ignore the XML Schema.'''

Would you like to continue?

