The Template Folder

The template folder, found in the root of the template file structure, holds all of the data that will be used to create the new database. Once again, there is a _rels folder for describing the relationships to the files in the template folder hierarchy. In addition, the template.xml file contains information about how the database should be created, and the database folder itself contains all of the information about the database objects that will be created. The following sections briefly describe these objects.

Probably the most pertinent file here is template.xml because it contains settings that affect the database. The settings in this file mainly affect localization, and need to be changed only if the raw files contained in the ACCDT file are changed after the file is generated by the Save as Template feature. That means if you always use Save as Template to create your template files, there will never be a need to modify any of the settings in any of the files contained here or elsewhere within the ACCDT file.

Preview Image

Although it is not directly used by the template to create a database, the preview image is stored in the template folder. It is usually named something like preview.jpg, but that name is not required. Remember, the preview image name and path is defined by the file in the _rels\.rels file contained in the root for the template. Also, the type of the preview image must be described in the content types XML file. For Access 2007, the JPG, BMP, GIF, and PNG image file formats are supported for the preview image in templates.


The template.xml file contains metadata about the format of the template file itself. There are six supported tags in this XML file:

□ TemplateFormat: The version number of the ACCDT file format. Because this is a new feature to Access 2007, the only supported value is 1.

□ RequiredAccessVersion: The minimum version of Access that is supported for the template. This number corresponds to the major build of Access. The lowest value this number can be is 12. This tag differs from the TemplateFormat tag because the major build of Access will be a number higher than 12 and it may contain new features that are not supported in Access 2007.

□ FlipRightToLeft: By default, the Right-To-Left (RTL) setting is turned off (set to 0). However, for some languages, like Arabic, the standard is to read from the right to the left and users prefer to use computer applications that way as well. Setting this tag to 1 turns on the RTL setting in the database created from the template, and all of the controls on forms and reports are reversed.

□ PerformLocalizationFixup: Because these templates are text files, it is possible to modify them (changing the text for a form's label control, for example) after they have been created. The problem is that the text in the label may then be clipped because the size of the label may not have been updated. If PerformLocalizationFixup is set to 1, the fixup features during template instantiation are executed, and all of the labels in the database will be resized, along with some other actions as well. This setting affects two different features:

□ Name Maps in the template: Fixup updates all controls, tables, and fields so that the controls still map to the proper objects.

□ Label controls: The Size-to-Fit feature is applied to all of the labels in forms and reports, except when the label is in a tabular layout or when the Tag property for the label includes ;DoNotResize; (note that the label is wrapped in semicolons).

□ PerformFontFixup: When this value is set to 1, the font fixup is run when the database is created. It simply resizes labels in case the template's font settings were modified after the template was created. Font fixup resizes labels to make sure that they are the correct size for the new font and that no text gets cut off. If this tag is set to 0, font fixup will not run.

□ VariationIdentifier: Defines the ID of the variation of the template and is used internally by Microsoft. Variations are used to create different versions of a template object for a specific locale, based on the language settings for the target database.

Database Folder

The Database folder contains all of the information about all of the database objects and settings that will be set when the new database is created. It is really the next major piece to the template and it's covered in detail a little later in the chapter.

_rels Folder

You have already seen the _rels folder, which can be found in the root of the template file itself. As mentioned before, the rels files describe the relationships to the objects contained within the template. In this particular _rels folder, you'll find the template.xml.rels file, which describes information about the template object relationships to the files contained in the ACCDT file package. For each relationship tag in this XML file, there are three attributes:

□ Target: Contains the path, starting from the template folder as the root, to the particular object in the ACCDT file.

□ Id: Contains information about the name of the object that the relationship is pointing to.

□ Type: The namespace of the object in the relationship that is being referenced.

The rels file can be thought of as describing information about the structure of the ACCDT file format. Each database object file in the Database folder, whether text or XML, needs to be defined in template.xml.rels contained in the _rels folder.

0 0

Post a comment