Templates: Cracking open ACCDT files

(This post was pre-recorded. I'll follow up on any comments when I'm back).

 

Since the Access 2007 template files are Open XML files, you can easily crack them open to take a peek. These are really ZIP files, so you can simply copy the ACCDT file somewhere (say, c:\temp), rename it to FOO.ZIP and open it using your favorite ZIP reader (or the OS, for that matter).

 

The first thing you’ll notice is that there are a number of folders and XML files all over the place. Well, it’s not called an Open XML file just for the fun of the name: all the meta-data about what’s in the file is written in XML. Some of the actual data CAN be in XML, but not necessarily so. These files support having binary data in them, such as image files (PNG, etc).

 

Below you have a snapshot of what the Issues template file looks like.

 

 

Let’s take a walk through the file so we can understand the big pieces.

 

· Root – At the root of the file there is the “[Content_types].xml” file. This file (below is a sample one) tells us what types of files are in this Open XML file. As you can see, we have some text, XML and XSD and binary (JPG, JPEG, PNG) files and other goo will talk about later.

 

- <Types xmlns="**https://schemas.openxmlformats.org/package/2006/content-types**"\>

<Default Extension="txt" ContentType="text/plain" />

<Default Extension="xml" ContentType="application/xml" />

<Default Extension="xsd" ContentType="text/xml" />

<Default Extension="jpg" ContentType="image/jpeg" />

<Default Extension="jpeg" ContentType="image/jpeg" />

<Default Extension="png" ContentType="image/png" />

<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />

<Override PartName=" /docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />

</Types>

· _rels – These folders are the heart of the relationship logic in Open XML files, and you will see a number of them in the folder hierarchy. Within this folder, in particular, there is a “.rels” file (sample below). This file points to the document-level information (core.xml), the preview image for this template (preview.jpg) and the description of the meat of the template (template.xml).

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <Relationships xmlns="**https://schemas.openxmlformats.org/package/2006/relationships**"\>

<Relationship Target="docProps/core.xml" Id="CoreDocumentProperties" Type="**https://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties**" />

<Relationship Target="template/preview.jpg" Id="PreviewImage" Type="**https://schemas.microsoft.com/office/access/2005/04/template/preview-image**" />

<Relationship Target="template/template.xml" Id="Template" Type="**https://schemas.microsoft.com/office/access/2005/04/template/start**" />

</Relationships>

· docProps – This folder contains the “core.xml” file. This file contains document-level information (also called the document property part) such as who created it, title, description, etc. This is not that interesting to us in the context of templates.

<?xml version=”1.0” encoding=”UTF-8” standalone=”yes” ?>

- <cp:coreProperties xmlns:cp=”**https://schemas.openxmlformats.org/package/2006/metadata/core-properties**” xmlns:dc=”https://purl.org/dc/elements/1.1/ ” xmlns:dcterms=”https://purl.org/dc/terms/ ” xmlns:dcmitype=”https://purl.org/dc/dcmitype/ ” xmlns:xsi=”**https://www.w3.org/2001/XMLSchema-instance**”\>

<dc:creator>Microsoft Corporation</dc:creator>

<dc:identifier>TC012253481033</dc:identifier>

<dc:title>Issues</dc:title>

<dc:description>Create an issues database to manage a set of issues or problems. You can assign, prioritize, and follow the progress of issues from start to finish. </dc:description>

<cp:keywords>Issues, Access, Template, Spotlight, Office Management, Project and Team Management</cp:keywords>

<cp:category>Business</cp:category>

<cp:version>1.0</cp:version>

<cp:lastModifiedBy>Template Creator</cp:lastModifiedBy>

</cp:coreProperties>

· template – This folder contains the meat of the file. It contains all the objects (tables, form, reports, etc) and data in the template. It contains the preview image (preview.jpg) that Access shows when you select the template file to create it and the main description of the template (in template.xml). This XML file contains some information that Access needs for internal processes. Mainly, it will tell us which versions of Access can use this template (versioning) and if we need to do any work for non-english templates, such as right-to-left language mirroring (localization).

 

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <Template xmlns="**https://schemas.microsoft.com/office/access/2005/04/template/start**"\>

<TemplateFormat>1</TemplateFormat>

<RequiredAccessVersion>12</RequiredAccessVersion>

<FlipRightToLeft>0</FlipRightToLeft>

<PerformLocalizationFixup>0</PerformLocalizationFixup>

<PerformFontFixup>0</PerformFontFixup>

<VariationIdentifier />

</Template>

Additionally, this folder also has a relationship folder with its template.xml.res file. This file describes all the relationships within the template folder (an example below). In the example, we have the database properties as a separate part, a table called “Contacts” and VBA references. I abbreviated the list below, so there should be other items (such as the Navigation pane settings, etc).

 

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <Relationships xmlns="**https://schemas.openxmlformats.org/package/2006/relationships**"\>

<Relationship Target="database/databaseProperties.xml" Id="DatabaseProperties" Type="**https://schemas.microsoft.com/office/access/2005/04/template/properties**" />

<Relationship Target="database/objects/tableContacts.xsd" Id="tableContacts" Type="**https://schemas.microsoft.com/office/access/2005/04/template/object**" />

<Relationship Target="database/vbaReferences.xml" Id="VBAReferences" Type="**https://schemas.microsoft.com/office/access/2005/04/template/vba-references**" />

</Relationships>