access-app.json
The project file of an Access application built by tools/build/Build-AccessApp.ps1: what the
application consists of and where its text sources are. The repository is the source; the ACCDB and
ACCDE are build artifacts.
New projects: the WKL Office SDK builds, exports and checks Access applications from sources with more steps than this build tool (status and sync with the open Access, roundtrip, MSBuild, an Access add-in), and takes
access-app.jsonover withwkl-office migrate access-app.json -o <folder>(documentation of the WKL Office SDK, „How to: Migrate a project of the build tool“). This build tool keeps working for existing projects.
Signature
{
"name": "Kunden",
"output": "out",
"references": [
{ "library": "WklForms", "major": 2, "minor": 0 },
{ "library": "WklJSON", "major": 1, "minor": 0 },
{ "guid": "{00025E01-0000-0000-C000-000000000046}", "major": 5, "minor": 0 }
],
"tables": "src/tables",
"modules": "src/modules",
"macros": "src/macros",
"theme": { "folder": "src/theme", "name": "Riviera" },
"ribbons": "src/ribbons",
"queries": "src/queries",
"forms": "src/forms",
"reports": "src/reports",
"controlBlocks": "src/controls",
"properties": { "AppTitle": "Kunden", "StartUpForm": "frmShell", "CustomRibbonID": "AppRibbon", "StartUpShowDBWindow": false },
"appModel": "src/app/app-model.json",
"accde": true,
"deploy": { "folder": "deploy", "version": "1.4.0", "targets": ["Administration", "Production"] }
}
Summary
Names the application and its source folders. Every entry except name is optional; a folder that
is not named is not built. Paths are relative to the folder of the project file; an absolute path (for example themes/riviera of the release package) is taken as it is, by the build and by the export alike.
Parameters
| Entry | Type | Default | Description |
|---|---|---|---|
name | text | – | File name of the ACCDB and ACCDE (letters, digits, _, ., -). |
template | text | none | A template project the application builds from as well: a folder with its own access-app.json (absolute, relative to the project file, or a name of the templates folder of the release package such as app-shell). Its files join the application's folders, a file of the application with the same name replaces the template's; references and properties are merged (the application's win), theme, ribbonModel, navPaneModel, controlBlocks and finish come from the template when the application names none. A template naming a template is refused. |
output | text | out | Output folder; -Output of the script overrides it. |
references | list | none | References to add: library = WklForms or WklJSON (the WKL type libraries), or guid of any type library; major and minor the version. |
tables | folder | none | *.sql files run in name order; statements separated by a line with only ; (CREATE TABLE, CREATE INDEX, INSERT in Access SQL). Lines that begin with -- are left out; Access SQL has no comments, so -- after a statement on the same line is refused (error 3078). |
modules | folder | none | *.bas and *.cls as the VBA editor exports them (UTF-8), also in subfolders; the module name is the file name. |
macros | folder | none | *.txt macros as SaveAsText writes them; the macro name is the file name. |
theme | object | none | folder with the parts of an Office theme (.thmx unpacked), name the theme's name. |
ribbons | folder | none | *.xml ribbon definitions (UTF-8); the ribbon name is the file name. |
ribbonModel | file | none | The model of the ribbon designer (JSON, UTF-8; from 1.49): checked, its ribbons written into USysRibbons next to those of ribbons, the model into USysWklRibbon, CustomRibbonID set to its application ribbon, and the callback module basWklRibbon generated. From 1.53 its context menu assignments are written into the forms and reports after they are loaded (Kontextmenüleiste of the object or control); an assignment naming a form or report the build does not create stops the build, a control name the form does not have is ignored. Needs WKL Forms Object Library 1.49 registered on the build machine (1.53 for assignments). |
appModel | file | none | The model of the WKL Application Designer (JSON, UTF-8; from 1.51; keys: app-model.json): title, icon, start form, ribbon and the user interface of each mode. Checked, stored in USysWklApp and applied for development after properties; a startup property named in both is the model's, with a warning. Its icon is a file next to the model, stored in the database. Needs WKL Forms Object Library 1.51 registered on the build machine. |
navPaneModel | file | none | The model of the navigation pane designer (JSON, UTF-8; from 1.50; keys: navpane.json): stored in USysWklNavPane and applied after forms and reports exist - the own category of Access's navigation pane with its groups and shortcuts, written for the environment of the build. An entry whose object the database does not have stops the build. Needs WKL Forms Object Library 1.50 registered on the build machine. |
queries | folder | none | <name>.query.txt as SaveAsText writes them. |
forms | folder | none | <name>.form.txt as SaveAsText writes them, UTF-16 or UTF-8. |
reports | folder | none | <name>.report.txt as SaveAsText writes them. |
controlBlocks | folder | control-blocks of the release package (in the repository docs/control-blocks) | Control blocks <Kind>.control.txt for placeholder rectangles. |
properties | object | none | Database properties: true/false become Yes/No properties, whole numbers Long, everything else text (AppTitle, StartUpForm, CustomRibbonID, StartUpShowDBWindow, AllowBypassKey …). |
finish | text | none | Name of a public function of a standard module of modules that the build runs after the properties, before the last compile and the ACCDE, in the same Access session (from 1.45.1). For steps the tool does not know: groups of the navigation pane, hidden objects, a start form set last. It returns "" or "OK" for success; any other text stops the build with that text. Only the function name: Application.Run takes no module name. |
accde | Yes/No | true | false builds the ACCDB only. |
deploy | object | none | The delivery (from 1.51; needs appModel): version (required, such as 1.4.0), targets (Development, Administration, Production; default ["Production"]), folder (default deploy). Each target gets a folder <folder>\<target in lower case> (for example deploy\production) with a copy of the ACCDB (development) or the ACCDE, the startup properties of its mode, `app-manifest.json`, and from 1.55 INSTALL.txt with the steps that make Access trust the copy on a PC (English and German). -Target of the script builds one target only. |
An entry the script does not know is refused with the list of known entries, so a mistyped name does not leave a part of the application out silently.
Remarks
- Order of the build: references, tables, modules and macros, compile, theme (embedded, database opened again, checked), ribbons, ribbon model, queries, forms, reports, navigation pane model, properties, application model, the
finishfunction, compile, ACCDE, delivery. Forms come after the theme because Access applies an embedded theme only to forms created after the database was opened again. - Which version a reference records:
majorandminorare the lowest version the build asks for, not the one the database keeps. Access records the highest version of that type library registered on the build machine with the same major version: with Release 2.3 registered,{ "library": "WklForms", "major": 2, "minor": 0 }gives a reference to 2.3 in the ACCDB and in the ACCDE. A lowerminortherefore does not make the ACCDE run on PCs with an older release; what an ACCDE built against a newer release does on such a PC is described under „Order of an update“ in deploy-to-user-pcs. To keep a database usable with an older release, build it on a machine where that release is registered. The build writes the recorded version intorequiresof app-manifest.json and warns when it is abovemajor.minor. - Placeholders for WKL controls: a rectangle in a form whose Tag (Marke) is
wkl:<Kind>-wkl:Grid,wkl:TreeList,wkl:ToggleSwitch… as the file names indocs/control-blocks- is replaced by that control with the rectangle's name, position and size, and with its anchors (HorizontalAnchor,VerticalAnchor) when the rectangle has them. Needed only for forms a script creates; a form edited in Access and saved withSaveAsTextalready contains its WKL controls. - The finishing function must handle its errors. An error it does not handle opens the runtime error dialog of VBA, which the hidden Access never shows: the build then ends at the time limit (
-TimeoutSeconds). Catch errors and return them as text. - The VBA project must compile. The build stops when it does not (
IsCompiled), naming the step; a compile error that waits for a dialog ends at the time limit. - Ribbon model and export:
Export-AccessAppwrites the model back into theribbonModelfile byte for byte (the database keeps its canonical text) and leaves out what the model owns: the modulebasWklRibbonand the model's ribbons in USysRibbons are not written as files. A hand-edited model comes back in the canonical form after the first build and export. The context menu assignments stay in the model; the exported form and report texts carry theShortcutMenuBarthe build wrote, so a second build writes nothing new. - Navigation pane model and export:
Export-AccessAppwrites the model back into thenavPaneModelfile byte for byte; Access's own pane tables are not exported. Groups and entries with conditions are written for the build machine (an ACCDB); an application whose pane differs per environment callsWklNavPane.Applywhen it starts. - Delivery without opening the application: the startup properties of a target are written into its copy with DAO; the copy is never opened, so its start form does not run during the build. The properties act when the copy is opened the first time (Access reads most of them only at opening).
AppIconis removed from the copy - it would name a file of the build computer - and written byWklApplication.EnsureApplicationat the first start; the icon acts at once. - What
deploydoes not do: it installs nothing, registers nothing and sets no trusted location. The folder is what a bootstrapper or an administrator places on the user's computer. - Application model and export:
Export-AccessAppwrites the model back into theappModelfile byte for byte, and the stored icon as the file next to it. - Template and export:
Export-AccessAppwrites no object of the template into the application, unless the application already keeps a file of that name (which replaces the template's object). To change an object of the template for one application, put a file of the same name into the application's folder first. - Text encodings: modules and ribbons UTF-8; forms, reports, queries and macros as
SaveAsTextwrites them (UTF-16), forms also UTF-8 with byte order mark.
Code example
A project with a shell and one page, the WKL Forms Object Library 1.38 and a custom ribbon:
{
"name": "Kunden",
"references": [ { "library": "WklForms", "major": 2, "minor": 0 } ],
"tables": "src/tables",
"modules": "src/modules",
"ribbons": "src/ribbons",
"forms": "src/forms",
"properties": { "AppTitle": "Kunden", "StartUpForm": "frmShell", "CustomRibbonID": "AppRibbon" }
}
Inheritance
None