Access Cookbook - Ken Getz [328]
TIP
When setting a reference to a COM component or program from Visual Studio .NET, it will always use the PIA if one has been installed on the system. Otherwise, it will create an AIA and use that instead.
As mentioned in the solution, Office 2003 ships with PIAs for each of its applications. You can download the PIAs for Access 2002 and the other Office XP applications from the following URL:
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/office.asp
Microsoft has no plans to supply PIAs for Office 2000 or Office 97, so you will have to generate and use AIAs for these applications.
See Also
See A Primer to the Office XP Primary Interop Assemblies (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office10032002.asp).
Chapter 18. XML
Support for Extensible Markup Language (XML) in Access 2003 has been greatly expanded from the XML support available in Access 2002. As you may be aware, Microsoft has chosen XML as the backbone for all of their .NET technologies. Access 2002 included XML support for importing and exporting data as well as for presenting data, but there was little support for transforming data by using XSLT stylesheets or for describing the structure if data using XML schemas. These capabilities were added in Access 2003, which provides very full-featured support for working with XML documents and technologies when importing or exporting data.
XML Overview
If you're not already familiar with working with XML, you may find all of the acronyms a bit confusing at first. However, XML syntax itself is fairly easy to understand.
The XML file
The first line of an XML file is the XML declaration, which specifies that the file is an XML document, that it conforms to the XML version 1.0 specification, and that it uses the UTF-8 character set. Most XML documents have this declaration, but Access is also capable of importing XML documents that do not:
The body of the XML file consists of tags similar to the tags used in HTML. Start tags begin with open angle brackets and end with closing angle brackets:
End tags begin with an open angle bracket and a slash, and end with a closing angle bracket:
The Car tag is also the name of the element. While HTML works with a limited set of elements, XML allows you to create your own, as long as you conform to some basic rules:
Names can contain only alphanumeric characters, the underscore character (_), hyphens (-), or a period (.).
Element names cannot contain white space and must start with a letter or the underscore character.
The values in XML elements are found between the start tag and end tag, similarly to the way that text is represented in HTML. In this example, the Car element has a value of Mini Cooper:
XML elements can be nested, but they can't overlap. The Car element can have sub-elements, such as Make, Model and Price:
TIP
Note that spaces, tabs and line feeds are ignored by the XML parser. They are used to make XML documents more readable.
You can also have multiple nested sets of elements in the same XML file, and elements can be repeated:
Root elements and namespaces
The above sample alone would not comprise a valid XML file. Each valid XML document must have a single root, or top-level, element. This allows the XML file to be represented as a tree, with all of the elements as branches off of the main root element. In this example, the starting tag is named dataroot, and has a namespace declaration: