Access Cookbook - Ken Getz [332]
Open the Car table in datasheet view. Note that an Autonumber value has been inserted for each row. Close the table.
Discussion
Once you have a schema file, you can view its structure using Internet Explorer, which indents all of the schema information for you, as shown in Figure 18-10.
Figure 18-10. The XSD file used to create the Car table
TIP
Visual Studio .NET provides an excellent tool for viewing and modifying XSD schema files. When you open a schema file in Visual Studio .NET, you get a graphical designer very similar to the Access Relationships window.
The file references two schemas. The xsd namespace references the XML Schema standard at the W3C's web site. The od namespace references the Office data schema developed by Microsoft for Office data types:
- The dataroot element is defined using a complexType XML Schema element, which enables it to contain other elements—in this case, Car elements. The maxOccurs="unbounded" attribute value means that the contents of the dataroot element, in this case Car, can occur an unlimited number of times. The xsd:element ref attribute indicates that Car is defined elsewhere in this XSD file: The Car element is defined next, which comprises the table definition. Application-specific information is stored in the The next section of the XSD file defines the columns of the table, their data types, sizes, and properties. Note that the ID element is tagged with both the od:jetType="autonumber" and the od:sqlSType="int" attributes: All of the columns are defined with both Jet and equivalent SQL Server data types. This allows you to import the XSD file into an Access Project (.adp). One step you would have to perform manually for SQL Server is setting the Identity property of the SQL Server table after you have imported the XSD file and prior to importing the XML file. See Also http://www.w3.org/TR/xmlschema-0/ The following MSDN article gives a good overview of XML Schema: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxml/html/understandxsd.asp?frame=true 18.4. Export
The World Wide Web Consortium (W3C) site contains the following primer on XML Schema: