*NOTE:* MOTW does not always get set on files, and won't if you extract with 7Zip.
4. *(Optional)* Adjust install options (see below).
5. Click **Install Add-In**.

## Install Options
*NOTE:* None of these are required to use the add-in, but they are designed to allow for easier installation and use.
|Setting |**Default**
*(Setting)*|Description
|-|:-:|:-
|**Trust Add-In Folder**|**Default: On**|During installation, the VCS Addin install folder will be added as a trusted location in Microsoft Access/Office. This allows Access to load the Add-In correctly in some protected setups, and will enable faster loading in others. The default install location is `C:\Users\%username%\AppData\Roaming\MSAccessVCS\`
|**Advanced Options**|**Default: Off**|In some protected computing environments you may need to select additional options. See below for more details.

|Setting |**Default**
*(Setting)*|Description |-|:-:|:- |**Use Ribbon Addin**|**Default: On**|With Version 4 and up the addin and most features can be directly launched with a custom ribbon. ||_On_|Install the ribbon and load to Access's ribbon. The ribbon will automatically load when Access loads, making launching version control much simpler. ||_Off_|Do not install the Ribbon. You can still load the Addin after installation by going to [Database Tools]>[Add-Ins]>[VCS Open] or [VCS Export All Source]. |**Open add-in after installing to trust the add-in file**|**Default: Off**|In some protected computing environments (I.e. Government, Banking), the Add-In must be opened from the install location to be properly trusted. This option will open the add-in file immediately after install, and give you the opportunity to trust the file. |**Install Folder**||By default, the addin will be installed to `C:\Users\%username%\AppData\Roaming\MSAccessVCS\`. If you need to select an alternate location for installation due to your development environment, security settings, etc., you can change the installation Folder.
**WARNING: You MUST _completely uninstall_ the Addin prior to changing the installation folder. Failure to do this may lead to unexpected issues and difficulty removing the addin.**
# Uninstall
[Click here for Uninstall Instructions]( *(Setting)*|Description
|-|:-:|:-
|**Show Detailed Output**|**Default: Off**|Enable verbose output of each step; useful when you're real curious. This may slow down Export and Build operations.
|**Debug VBA Errors**|**Default: Off**|*(Advanced Users/Add-in Developers)* If an unexpected error occurs in the add-in code, stop and open the VBA IDE to do further debugging. This may be helpful when debugging a problem with the add-in, or reviewing an existing issue. *You should generally keep Off unless trying to find the source of a bug, or doing development work on the add-in.*
|**Show Legacy Prompts**|**Default: On**|If upgrading from the integrated version of this project, there may be legacy VCS modules left in your database project that are no longer needed. This will notify you if these legacy modules are found. If you would like to keep them in your project, you can clear this option to disable the notification.
|**Use short hashes in index**|**Default: On**|If on, `git` style hashes (first 7 characters) will be used in the file index. *NOTE: This was done to improve readability and reduce file size, but you can always uncheck this box if you want to store the full hash.*
|**Hash Algorithm**|**Default: SHA256**|Choose the hashing algorithm here. This may affect build time if you choose a more complex option. Hashes are used to help determine whether source files changed between import/export operations.
||~~*SHA1*~~|Use SHA-1 hashing algorithm. ([Not recommended](https://en.wikipedia.org/wiki/SHA-1). While hashing is not used for security purposes in this add-in, any usage of SHA1 is not allowed in some network environments.)
||*SHA256*|Use SHA-256 hashing algorithm.
||*SHA512*|Use SHA-512 hashing algorithm.
|**Developer Settings**||_Note:_ Developer Settings are local-only and are not saved in the settings config. They are set as a registry preference (same as install preferences).
|File Diff Tool|**Default: WinMerge**|Select the diff tool used by git.
||_WinMerge_
||_VSCode_
||_TortoiseGitDiff_
|**Open Repository**|**Default: [Blank]**|Select the tool you want to use to open the repository for git integration.
||_[Blank]_
||_Github Desktop_
||_VSCode_
||_SourceTree_
||_Tortoise Git_
|**Language**|**Default: English**|Select the language used by the AddIn. NOTE: Not all screens or prompts have been updated to use translation. When not updated, the text will display in **English**. See [Translations Page](wiki/Translations) for more details.
||English (Localization Testing)|Used when performing localization tests.
||English
||Brazilian Portuguese
|[Translations...]()||Click the Translations... link to open the Translation Tab. See [Translation](wiki/Translation#Options-Translation-Tab) for more detail and how to use this feature.
## Export Tab
Note that these options only determine what is *Exported* and saved to the JSON file. Any settings defined in the JSON source file will be applied when the Form or Report object is imported, regardless of the currently specified options.

|Setting *(Setting)*|Description
|-|:-:|:-
|**Export Folder** |**Default: [Blank]**| Keeping this blank ensures the source code stays local to the development file, and works best with git and other version control systems. Your environment may need other options.
||*[Blank]*|Use default name of `\[database.accdb].src`, i.e. `\Test.accdb.src`
||*Relative Path*|Prefix folder name with a backslash. For example, to export source into a subfolder called `Source`, you would enter `\Source` in this box.
||*Absolute Path* |You may also use a full path name to a folder. I.e. `W:\Git\Projects\Vehicles Database`
||*Placeholder* |In combination with the above options, you may also use a `%dbName%` [placeholder](https://github.com/joyfullservice/msaccess-vcs-integration/issues/139) to use the database filename in a custom path. I.e. `\src\%dbName%.src\`
|**Use Fast Save**|**Default: On**|Major performance gain with small changes to large projects. This attempts to only export the objects that have changed since the last export. This especially helps to not have to export forms and reports if they have not changed.
|**Extract Theme Files**|**Default: Off**|Extract the contents of the `*.thmx` files. Microsoft Office Theme files `*.thmx` are actually zip files containing XML and other files that define the specifics of a theme. You can use Theme Files for form style and color consistency. If you are customizing a theme, you may wish to extract these files so your changes can be tracked in Version Control. **_Note:_** _Extracting Theme files may create noise in your database due to slight variations in rendering machine to machine._
|**Sanitize Level**|**Default: Standard**|Set level for sanitize routines to remove noise. Sanitizing allows you to remove noise from your exported files. Turn off to export raw file outputs. Sanitization routines are checked to ensure most do not affect building of exported files.
||*None (Off)* | Turn off sanitization, export raw files. These may not import properly, but they may be useful when trying to troubleshoot. _**Note:** Files will still be converted to UTF-8 or System Codepage encoding depending on Access Version in this mode._ **_NOTE:_ If you set Sanitize level to "*None (Off)*", none of the Sanitize Options will be used.**
||*Minimal*| Only basic sanitization to ensure reliable rebuilding of files.
|| *Standard*| Remove most exported noise (GUIDs, the like). Removes object GUIDs, name maps, and other data that changes from build to build. (These values are recreated automatically when importing source files.) From a development perspective, these are more like binary artifacts that just add noise to the version control commits, reducing clarity on actual code changes.
||*Extended*|Remove as much as possible. This may lead to unexpected changes upon rebuilding. Features that are still in testing or confirmed to be temperamental may be introduced here prior to being implemented. **_User beware!_**
|**Sanitize Colors**|**Default: Minimal**|Removes color exports on forms where themes are used, or other situations where the color can be correctly set upon rebuild. These colors export differently in different machines, or different settings and are largely noise. ***NOTE:* The most aggressive options may lead to unexpected color changes on forms!**
|**Save Printer Settings**|**Default: On**|Saves a copy of the print configuration for reports and forms. This is especially useful when you are using specific printer settings. The output is stored in human-readable json. By default, page orientation and paper size are saved with each report, but additional options are also available. **_Note:_** If you also select `Save Printer Settings` an additional printer setting `.json` file will be exported as well; this option is separate from printer exports. **Note:** See [Split Files Wiki page](https://github.com/joyfullservice/msaccess-vcs-addin/wiki/Split-Files) for additional documentation on the feature and how to migrate to it if your source code did not start with this option set.
||_On_|The layout and colors of Forms and Reports will be exported to a `.bas` file and the code components will be exported to `.cls` file.
||_Off_|Forms and reports will be exported as a single `.bas` file.
|**Run Sub Before Export**|**Default: [Blank]**|Run a VBA subroutine before exporting the source code. This can be used to clean up temporary data, mask sensitive information, or anything else you want to do. This will be called using `Application.Run`.
|**Run Sub After Export**|**Default: [Blank]**|Similar to the option above, this allows you to specify a VBA subroutine to run *after* exporting the source code.
## Databases (External)

The Databases Tab allows you to use this tool to export externally backend connected databases from MySQL or Microsoft SQL Server (MSSQL). This can allow new developers without other version control tools to track changes on the backend and "sync" them to front end tools.
This tool is limited, and does not have the full featured tools of other Database tools such as SSMS.
**This is an _EXPORT ONLY_ feature: this will not send data to your database.**
*This tool only provides a 'quick export' fuction due to the significant time required to perform the SQL export. To perform a full export, delete the `\Databases\` folder in your VCS folder. Changes are tracked in the index, so you shouldn't miss anything.
|Setting *(Setting)*|Description
|-|:-:|:-
|**Database List**||Lists database connections which will be exported by this tool. Double click on database connection to edit.
|**Delete**||Delete selected database connection.
|**Edit**||Edit selected database connection information.
|**Add**||Add a new database connection.
### Database External Connection Editing

|Setting *(Setting)*|Description
|-|:-:|:-
|**Connection Name:**||Human readible name for the database connection. The Database Name is typical for this.
|**Enabled**|**Default: On**|Export this connection. If disabled, this connection is skipped (not exported) when running an export operation.
|**Use UTC Dates**|**Default: Off**|Use UTC Timestamps and dates when exporting SQL details. This can be very helpful when your developers are in disparate time zones.
|**Database Type:**|**Default: Microsoft SQL Server**|The backend server type for the external database.
||_Microsoft SQL Server_|Select this if your external database is hosted on a Microsoft SQL Server instance.
||_MySQL Server_|Select this if your external database is hosted on a MySQL Server instance.
|**Description:**||If you wish to provide additional context to the Connection Name, type it here. Examples might be "Production", or "Test", or "Staging1"
|**ADO (OLE) Connection String:**||The ADO (OLE) Connection string. This needs to be an OLE connection string as this tool is built on the ADODB functions. The examples which populate automatically are based on linked tables in your database, and are generally ODBC connection strings. If you have an MSSQL type database backend, this tool can attempt to create a compliant OLE connection string.
|**Save in .env file**|**Default: On**|Save the connection string (and passwords) in a `.env` file. **NOTE: ensure the `.env` files are excluded from version control if you have a password string.**
|**Attempt Conversion to ADO (OLE) String**|**Default: On**|Attempt to convert linked table string from ODBC to OLE.
|**Filter for database objects (source file paths):**||Use this to exclude objects from export. An example might be that you do not want the code for a login check to be exported, or you do not want some views exported.
## Table Data

The Table Data tab allows you to selectively include certain tables from which to include table ***data*** in version control. The *structure* of the tables is already being saved, but this gives you the additional option of saving the *data* itself.
The dialog box shows tables in the database. If the column does not show an option in *Export As* the data is not exported for that table. The example screenshot shows the tables in the Addin.
An example of where you might use this would be a table that defines options or settings in your database application. You might want to track when these settings change. Another example would be a `USysRibbons` table that defines the layout of a custom application ribbon. Note `USysRibbons` is stored by default.
The concept here is that you are selecting the table from which you want to save data, choosing the format to use, and clicking Update to save the changes.
**Note:** See [This FAQ](https://github.com/joyfullservice/msaccess-vcs-addin/wiki/FAQs#how-do-i-also-export-data-from-all-the-tables-in-my-database) for discussion on exporting all tables. Putting production data into version control may have significant PII/Cybersecurity/other consequences and is generally frowned upon.
|Setting *(Setting)*|Description
|-|:-:|:-
|**Show Hidden**|**Default: Off**|List hidden tables in the current database.
|**Show System**|**Default: Off**|List system tables in the current database.
|**Show Other**|**Default: Off**|List table names that are saved in the options, but do not exist in the current database. You can also manually add table names to your `vcs-options.json` file. (Add a table through the interface first, and use the same syntax.)
|**Selected Table**||This highlights which table you have selected to set the export format. To add a table that is not listed, click the [*Other...*](#table-data) link.
|Selected Table: **Other...**||Click [*Other...*](#table-data) to enter a table name that doesn't exist in the database but you want to export if found.
|**Export As**|**Default: Tab Delimited**|Select the format to use for the exported data.
||*Tab Delimited*|Separate values with tab character. This is a good format to use when importing to Microsoft Excel, or reading the values in Version Control files.
||*XML Format* (Suggested)|Select this option for the most complete and robust representation of the data. It is harder to read in source files, but should import back in to accurate recreate the original data.
||*No Data* (BLANK) |Don't save data for this table.
|**Other Table Name**||Enter a table name to directly save output specification changes for the table. You should see the Save Data column update in the list of tables when you click the Update button. See [Issue 250](https://github.com/joyfullservice/msaccess-vcs-addin/issues/250) for additional discussion on this feature.
|**Export As**||Select the export format to export table.
### Default Tables
The following tables are added to the default list, but can be removed (if you desire...we strongly suggest you keep them).
| Table Name | Type | Explanation
|-|-|-
| `USysRegInfo` |System | Stores registry information about Access (such as installed tooling). Exports as _Tab Delimited_.
| `USysRibbons` |System | Stores custom ribbon information. Exports as _Tab Delimited_.
**NOTE:** The following tables should not be added to the export list, as they are already handled by this tool elsewhere.
| Table Name | Type | Explanation
|-|-|-
| `MSysResources` |System | Images and Themes are exported in the `.\images\` and `.\themes\` folders, respectively.
## Build

A unique feature of this add-in is the ability to build a fully functioning database completely from source files. This allows multi-user development in a more typical development workflow where source files are exported and combined to build the end product.
|Setting *(Setting)*|Description
|-|:-:|:-
|**Force import of original SQL for queries**|**Default: Off**|In some cases, such as when a query contains a subquery, _AND_ has been modified in the visual query designer, it may be imported incorrectly and unable to run. For these cases we have added an option to overwrite the .SQL property with the SQL that we saved separately during the export. See [issue #76](https://github.com/joyfullservice/msaccess-vcs-integration/issues/76) for further details.
|**Run Sub Before Build**|**Default: [Blank]**|Same as below, except before the build.
|**Run Sub After Build**|**Default: [Blank]**|Run the specified subroutine after building the project from source files. This is a great way to extend the add-in to add any custom post-build functionality that you need after the build finishes. For example, you might use this to trigger an automated testing routine that verifies that the application is fully functional.
## Settings
These affect your system at large; not just the currently open Access Project.

|Setting [Click here for Install / Uninstall Instructions](Installation)
================================================
FILE: Wiki/Project-Scope.md
================================================
I personally believe that one of the keys to the long-term success of this project is establishing a clearly defined scope of what it is intended to do, and sticking to that scope.
## Guiding Principles
Since much of this could be considered subjective archetecutual design decisions, let me outline some of the guiding principles that I am trying to keep in the forefront of this project.
* The **fundemental purpose** of this add-in is two-fold:
* **Export** database objects as source files
* **Import**/**Build**/**Merge** source files to database objects
* The goal is to replicate the original database as **closely as possible** when building from source.
* The add-in is **not intended** to fix/repair/enhance the target database, other than what is necessary to perform the basic functions of exporting and importing source files.
* The **user interface** should be as intuitive and user-friendly as possible. It should be both efficient for the expert, and easy for the beginner. Flexibility without clutter.
* The tool should be **extensible**, where internal code can be added to carry out additional tasks outside the scope of this add-in.
## How Features are Evaluated
Features add complexity, and complexity increases [cost of carry](https://martinfowler.com/bliki/Yagni.html). Great features are welcomed and make this tool better every year. Unecessary or overly complex features bog down the project and slow progress on more important issues.
**Feature considerations:**
* How many users does this affect? Will this benefit everyone, or just a single user with a really unique setup?
* How complex is the feature? Is it limited to changes in a few areas of code, or are we talking about a significant refactoring?
* Do functionality changes cause any risks for those currently using the add-in in production environments?
If your idea didn't get implemented, don't take it personally. :-) Remember, this is an ongoing work in progress, and someone has to make the hard decisions about what gets added and what doesn't.
================================================
FILE: Wiki/Quick-Start.md
================================================
# Quick Start
This add-in performs two primary functions to support rapid application development in Microsoft Access.
- **Export** - Generate text-based source files representing the database components of your project. (table structure, queries, forms, [etc...](Supported-Objects))
- **Build** - Build a fully functional version of your database project directly from source files. You can also [merge](Merge-Build) updated source files into an existing project.
## Install Add-in
1. Download the [latest release](https://github.com/joyfullservice/msaccess-vcs-integration/releases/latest) from GitHub.
1. Extract `Version Control.accda` from the downloaded zip archive to a trusted[^1] location.
1. Open `Version Control.accda` to launch the installer.
1. Click **Install Add-In**.

## Export Source Files
After installing the add-in, you should see a new ribbon toolbar in Microsoft Access. Open your database project, then click **Export** on the ribbon.

This will launch the add-in and export your project to source files. (By default, in a subfolder under your database project.)

Subsequent exports will be much faster because they will only export changed items.

At this point you can switch over to your version control system (I like GitHub Desktop) and commit the source changes to version control.

## Build From Source
At some point you will probably want to build your project from source, perhaps pulling in source changes from other developers. With your project open, simply click **Build From Source** on the ribbon.

After clicking to confirm the build from source, the add-in will save your current database as a backup, and build a fresh copy from source files.

All set! Your freshly built database is ready to use and continue development. (Note that the first export after a build will be a full export.)
Feel free to check out other wiki pages to learn about [additional options](Options), [merge builds](Merge-Build), [FAQs](FAQs), and more.
Enjoy!!
[^1]: This location must be trusted by Microsoft Access, or the add-in file must be trusted to allow the VBA installercode to run correctly. See `Microsoft Access` -> `Options` -> `Trust Center` -> `Trusted Locations`.
================================================
FILE: Wiki/Security-Considerations.md
================================================
We have worked hard to make this add-in as accessible to as many environments as possible, including those that have higher security requirements. It does not require administrative privileges to install or run, and utilizes a trusted location to allow global settings to remain more restrictive.
The entire project with all source code is available on GitHub at: [joyfullservice/msaccess-vcs-integration](https://github.com/joyfullservice/msaccess-vcs-integration) See [LICENSE.txt](https://github.com/joyfullservice/msaccess-vcs-integration/blob/master/LICENSE.txt) for specific terms and disclaimers. (BSD-style license)
# Minium Security Requirements
The following settings need to be allowed in the Security Center for the add-in to be able to interact with databases and function as designed.
- **Allow Trusted Locations** (Including network locations, if the database is not on the development computer.)
- **Allow Trusted Documents** - In some environments the add-in file must be trusted as well.
- **ActiveX Settings - Prompt before enabling** - This is required for importing XML content, such as table definitions.
- **COM Add-ins** - Needed to use the Ribbon toolbar. (Primary launcher for Version 4 and above)
# Normal Behavior
This add-in was created in Microsoft Access VBA, which gives a powerful platform for developing a highly performant add-in with easily accessible source code and live debugging capabilities.
As with any Microsoft Access add-in, this powerful tool comes with inherent security considerations. This page is intended to guide you in understanding some of the fundamental operations of the add-in, and how this might affect the security of your systems and data.
## Export to Source Code
An existing database can be exported to (primarily) text-based source files that can be committed to a file-based version control system such as Git. While primarily focused on the database *component* objects like forms, queries, table definitions and VBA source code, you can optionally choose to export *data* from tables as well.
Here are a few considerations to think about when exporting to source:
- Some connection information, such as ODBC connection strings may be present in your exported source files.
- Paths to network locations and the database location may be present in some source files.
- Any table data that is exported could contain PII or other sensitive content, which could then be easily committed to version control.
- Access to the exported source files should be protected, just like you would protect the database itself.
## Build from Source Files
This add-in provides the ability to build a functioning database application entirely from the source files saved during an export. This is a very powerful collaboration tool when combined with a version control system. Changes at the source file level can be merged and used to build a specific version of a database application.
Here are some potential security considerations when building from source:
- Probably the most important aspect here is to protect your *source files* from any unauthorized modifications.
- The build operation can include "hooks" to run specific VBA code during or after the build process. This is a very powerful feature, but could be used maliciously by someone with access to the source files.
- Any source files from external locations should be carefully reviewed before including in a project for build.
## Add-in Behavior
During the export and/or build process, the add-in uses the following:
- **`CreateObject()`** - Create ActiveX objects like `Shell.Application`. (Most objects are created using early binding.)
- **Windows API Calls** - Used in many areas including performance timing, string hashing, and time zone determination.
- **Files** - Creates, modifies and deletes source files for the project.
- **Registry** - Reads and writes values to the Windows registry. (Current User Hive)
# File System Access
Most of the processing happens in the source folder for the database, but the user's Windows temporary folder is also used for processing and comparing source files.
The add-in is installed in the user's `AppData` folder, and includes the COM add-in ActiveX DLL that provides the application Ribbon interface.
# Registry Access
The registry is used to store certain program settings, as well as transient values used during some processes like building from source. Other registry settings are used to determine security settings in the current environment.
The following sections are both read and written by the add-in.
**Trusted Locations** - Used when making the add-in installation path a trusted location.
`HKCU\Software\Microsoft\Office\[version]\Access\Security\Trusted Locations\`
**Add-in Menu** - Adds shortcuts to the Microsoft Access add-ins menu. (The primary way to launch the add-in before the ribbon was added in version 4.)
`HKCU\Software\Microsoft\Office\[version]\Access\Menu Add-Ins\`
**Ribbon UI** - The ribbon was created in twinBASIC as a COM add-in (ActiveX DLL) which is self-registering using a call to `regsvr32` during the installation process. (COM registration entries are also created in the current user hive.)
`HKCU\SOFTWARE\Microsoft\Office\Access\Addins\MSAccessVCSLib.AddInRibbon`
**Local Settings** - Program settings and transient values. (VBA's native `GetSetting`/`SaveSetting` functions.)
`HKCU\SOFTWARE\VB and VBA Program Settings\MSAccessVCS\`
# Telemetry
This add-in does not communicate in any way with remote servers or systems. It does not check for updates or send any usage statistics, and does not require an Internet connection to use the tool.
That being said, it *can* interact with linked tables and potentially remote servers and systems in connection with databases being exported or built from source. This is entirely within the configuration and intended usage of the add-in.
For example, if your database has a linked table on a SQL server, the add-in will attempt to connect to this remote table to retrieve a list of columns that are written to a source file. This all happens locally within the context of your network environment and development computer.
# Encryption / Cryptography
Some countries and corporate environments have specific requirements when it comes to cryptography. Here are a few ways this add-in uses cryptography:
- **Zip** - Database theme files (`*.thmx`) natively use Zip compression.
- **File Hashes** - Used to detect and index changes to files. These hashes are `SHA256` by default, but can be changed to `SHA1` or `SHA512` in the add-in options.
- No reversible encryption is used in this project at this time.
# VBA References
In addition to the built-in Microsoft Access references, this add-in also uses the following references:
- **Microsoft ActiveX Data Objects 6.1 Library** - For ADO interactions with some database objects.
- **Windows Script Host Object Model** - For registry access.
- **Microsoft Office [version] Object Library** - For open dialogs and other general Office integration.
- **Microsoft Scripting Runtime** - For `FileSystemObject` and other related components for interacting with the file system in a Unicode compliant way.
- **Microsoft Visual Basic For Applications Extensibility** - For interaction with VBA source code components.
- **Microsoft VBScript Regular Expressions 5.5** - For parsing source file content.
- **Microsoft XML, v6.0** - For managing XML source file content.
- **Microsoft Forms 2.0 Object Library** - For interacting with native VBA forms (different from Microsoft Access forms).
- **UIAutomationClient** - For interactions with navigation pane objects, such as selecting a single object for export.
# Additions / Updates
If you have further items that would be helpful to add to this page, please feel free to open an issue or create a pull request!
Reviewed 4/19/2023 by @joyfullservice
================================================
FILE: Wiki/Split-Files.md
================================================
One of the challenges with the .git system is that when a single file is split into two different files the line history *might* follow one of the files, but not both. You loose the line history in one or both files.
That might be a serious problem if you have years of history that you are wanting to preserve. Thankfully, there is a [technical workaround](https://devblogs.microsoft.com/oldnewthing/20190919-00/?p=102904) that does allow you to preserve the history in both files.
# Please Read Before Splitting Files in Existing .git Projects
You can turn on the option and simply perform an export to split the files, **but if you want to preserve the .git history in both files**, please read this section carefully. This add-in includes a utility to help you split the files while retaining the line history in both files. Because this involves **committing** to the repository as part of the process, I want to clarify exactly how this works.
# How This Works
Because this isn't a built-in feature in .git, we need to implement a bit of a clever workaround as documented by Raymond Chen in [this article](https://devblogs.microsoft.com/oldnewthing/20190919-00/?p=102904). In a nutshell, we will create a (temporary) new branch in git, rename the file in the new branch, restore the original file, then merge the new branch back into the original. This will result in two files that both carry the history of the original file.
# Before You Start
You will need to run this process from a **clean branch**. If you have any outstanding changes, please commit or discard them before splitting files. Be aware that this will create **two additional commits** in your repository, so it can be helpful to do this for batches of files, rather than individually for each file.
# Select and Split Layout from VBA
On the VCS ribbon, click Open the **Advanced Tools > Split Files** to open the following dialog.

Click the *Add Forms and Reports...* link to automatically load in the source files for the forms and reports in the current project and create the corresponding `*.cls` files.
Click the button to Split Files. This will begin the automated process of splitting the files while preserving change history. Details and the full output of the git commands can be found in `git.log` in the source files folder.
With the files now split, turn on the VCS option to **Split Layout from VBA** and run an export. At this point you should see both source files modified for each object as the layout is removed from the class file, and the VBA is removed from the layout file.
That's it! Now the VBA code changes can be tracked in the `*.cls` file, and the layout in the `*.bas` file.
================================================
FILE: Wiki/Supported-Objects.md
================================================
# Compatibility
This page outlines the types of objects and information that can be exported from a Microsoft Access Database and which items are supported when building a database from source files. If you find that you are missing something in the export or import, please open an issue and link it to the appropriate row in the table.
Legend: ✔️ Fully supported ⚠️ Partially supported ❌ Not supported
## Summary
Most types of objects can be exported and imported using this tool.
|Type |Export|Import|
|---------|:----:|:----:|
|Tables |✔️|✔️|
|Queries |✔️|✔️|
|Forms |✔️|✔️|
|Reports |✔️|✔️|
|Macros |✔️|✔️|
|Modules |✔️|✔️|
|Database Settings|✔️|✔️|
## Detailed List
If you are looking for a specific type of object or property that you want to export or import, you can refer to the following more comprehensive list. (Updates and additions welcome.)
The *Testing* column indicates whether a test item and testing code has been created in the *Testing.accdb* database to verify that particular item after import from source code. *Test location* indicates where to find the object in the database.
|Type |Export|Import|VBA Class|Testing|Test Location|
|---------------------------------|:----:|:----:|---------|:-----:|-------------|
|💼 **TABLES**
|Access Table |✔️|✔️|clsDbTableDef|✔️|tblInternal|
|Extended Properties |✔️|✔️|clsDbTableDef|✔️|tblInternal|
|Table SQL |✔️|✔️|clsDbTableDef|✔️|tblInternal|
|Linked Table |✔️|✔️|clsDbTableDef|✔️|tblLinkedAccess|
|Linked PrimaryKey |✔️|✔️|clsDbTableDef|✔️|tblLinkedAccess|
|ODBC Table |✔️|✔️|clsDbTableDef||
|Linked Structure |✔️|✔️|clsDbTableDef|✔️|tblLinkedAccess|
|Table Data (TDF) |✔️|✔️|clsDbTableData|✔️|tblInternal.txt|
|Table Data (XML) |✔️|✔️|clsDbTableData|✔️|tblSaveXML.xml|
|Table Data Macros |✔️|✔️|clsDbTableDataMacro|✔️|tblSaveXML|
|💼 **QUERIES**
|Designer Layout |✔️|✔️|clsDbQuery||
|SQL Output |✔️|✔️|clsDbQuery||
|Pass Through Queries |✔️|✔️|clsDbQuery||
|💼 **FORMS**
|Form objects |✔️|✔️|clsDbForm||
|Saved print settings |✔️|✔️|clsDbReport|Optional
|💼 **REPORTS**
|Report objects |✔️|✔️|clsDbReport
|Saved print settings |✔️|✔️|clsDbReport|Optional
|💼 **MACROS**
|Macro objects |✔️|✔️|clsDbMacro
|💼 **MODULES**
|Standard Modules |✔️|✔️|clsDbModule
|Class Modules |✔️|✔️|clsDbModule
|Object Modules |✔️|✔️|clsDbModule
|Hidden VBE Attributes |✔️|✔️|clsDbModule
|💼 **DATABASE**
|DAO Properties |✔️|✔️|clsDbProperty
|Project Properties |✔️|✔️|clsDbProjProperty
|Object Descriptions |✔️|✔️|clsDbDocument
|Hidden Attribute |✔️|✔️|clsDbHiddenAttribute
|Remove Personal Info |✔️|✔️|clsDbProject
|Application Icon |✔️|✔️|clsDbProperty
|Embedded Images |✔️|✔️|clsDbSharedImage
|Saved Imp/Exp Specs |✔️|✔️|clsDbSavedSpec
|System Imp/Exp Specs |✔️|✔️|clsDbImexSpec
|Summary Properties |✔️|✔️|clsDbDocument
|Relationships |✔️|✔️|clsDbRelation
|Nav. Pane Groups |✔️|✔️|clsDbNavPaneGroup
|Embedded Office Theme(s) |✔️|✔️|clsDbTheme
|CommandBars (Menus and Toolbars) |✔️|◒|clsDbCommandBars
|💼 **VBE PROJECT**
|Project Properties |✔️|✔️|clsDbVbeProject
|Compilation Arguments |✔️|✔️|clsDbVbeProject
|GUID References |✔️|✔️|clsDbVbeReference
|File/Lib References |✔️|✔️|clsDbVbeReference
|Forms 2.0 documents |✔️|✔️|clsDbVbeForm
|💼 **ADP PROJECTS**
|Connection Settings |||clsDbProjProperty
|SQL Functions |✔️|n/a|clsAdpFunction
|SQL Views |✔️|n/a|clsAdpServerView
|SQL Stored Procedures |✔️|n/a|clsAdpProcedure
|SQL Tables |✔️|n/a|clsAdpTable
|SQL Triggers |✔️|n/a|clsAdpTrigger
|💼 **EXTERNAL DATABASE**
|Microsoft SQL |✔️|n/a|clsSchemaMsSql
|MySQL/MariaDB |✔️|n/a|clsSchemaMySql
|💼 **OTHER**
|Saved VCS Options |✔️|✔️|clsOptions
## ADP Projects
Working with *.adp files is very similar to working with regular (MDB) Microsoft Access databases. All of the main database objects can be exported and imported just like MDB files. When it comes to SQL server objects, the object definitions are exported for tracking in source control, but this system does not attempt to modify any SQL server objects. (Hence the n/a note on importing SQL objects.)
## CommandBars (Menus and Toolbars)
All commandbars can be exported. However, there are known instances of legacy commandbars that may fail to import. In those cases, those commandbars are "built-in" but are in fact customized version. If the commandbar's Id no longer exists in the Access, the build will fail. We do handle a subset of the custom built-in Access commandbars, particularly those designed to open a specific Access object. Here's a table of supported custom built-in commandbars:
| Id |Command |
|----|------------------------------|
|1835|Open Table
|1836|Open Query
|1837|Open Form
|1838|Open Report
|1839|Run Marco
|3885|Open Access Data Page
|3886|Open Server View (ADP)
|~3887~|~Open Database Diagram (ADP)~
|3888|Open Stored Procedure (ADP)
NOTE: The database diagram command is not included because we were unable to create a custom commandbar with this Id. If anyone has this and wish to support this, submit a PR including the commandbar.
If your application project contains legacy ocmmandbars that cannot be built becuase they are custom and are not in the list, and you do not wish to lose the functionality, you can make use of the [After Build procedure](https://github.com/joyfullservice/msaccess-vcs-addin/wiki/Options#build) and perform the import. You can call ImportCommandBars routine to perform the import from a template file. For an example of this, refer to the code [here](https://github.com/joyfullservice/msaccess-vcs-addin/blob/5744030b02b5d4e9c7677a05e5016a4c347dea76/Version%20Control.accda.src/modules/modVCSUtility.bas#L1096-L1107) and [here](https://github.com/joyfullservice/msaccess-vcs-addin/blob/5744030b02b5d4e9c7677a05e5016a4c347dea76/Version%20Control.accda.src/modules/modVCSUtility.bas#L1375-L1479).
## Supported Versions
This add-in is designed to work in Microsoft Access 2010 and newer. Access 2007 users, please see [this issue](https://github.com/joyfullservice/msaccess-vcs-addin/issues/464).
Missing something? Create an issue or a pull request.
================================================
FILE: Wiki/Terminology-and-Style-Guide.md
================================================
This page contains style and terminology for how to describe elements within the Wiki, Code, and Interface for a consistent approach.
This is a constant work in progress, and is not complete. Items added here were added for clarity where a universal consensus may not exist.
Use active voice for documentation.
Where not found here, use of [Google's Style Guide](https://developers.google.com/style/) is generally accepted; though some deviations from their guide have been made in favor of other methods where appropriate.
# Action / Descriptor Terms
The following are either excerpted or differ from the above style guide. Use these methods first. If you don't find what you need here, go to the above guide(s).
|Item|Term|When used
|-|:-:|-
|Checkbox **State**|**On** (☑) Within `Code`: `True` |Checkbox has a check in it. **For user-facing content:** Use **On** (TagTips, Form Text, Wiki Documentation, etc.). **For `code` comments:** You may use `True`, as you will be working with the `boolean` value directly. **NOTE:** This differs from the *Action* performed on the **Checkbox**.
||**Off** (☐) Within `Code`: `False`|Checkbox is cleared. **For user-facing content:** Use **Off** (TagTips, Form Text, Wiki Documentation, etc.). **For `code` comments:** You may use `False`, as you will be working with the `boolean` value directly. **NOTE:** This differs from the *Action* performed on the **Checkbox**.
||**`Null`**|In some cases, [checkboxes](https://docs.microsoft.com/en-us/office/vba/api/access.checkbox.triplestate) may allow a `TripleState` of `Null`; this may also be referred to as `Indeterminate`. See also [Tri-State](https://en.wikipedia.org/wiki/Checkbox#Tri-state%20checkbox) `Null`. *Example:* In permission lists, if a parent permission includes children, and some of the children are set to allow, and some are off/cleared, the parent may appear in an indeterminate state. All cases use: `Null`. Appears as a square or gray interior inside the checkbox instead of a checkmark or cleared state.
|UI **Action**|Select|Chose the **(Option name)**, set **(Option name)** checkbox state to `True`. *Example:* Select **Use Fast Save** to enable a significant performance boost.
||Clear|Clear **(Option name)** checkbox (set state to `False`), remove text. *Example:* Clear **Use Fast Save** to export all elements in your file every time.
|Keyboard Keystrokes|\|Enclose keystrokes with the \ tag. To group simultaneous keystrokes, use the + charachter. *Example:* `Press [Shift]+[Q] to do a fancy thing.` will render like this: Press [Shift]+[Q] to do a fancy thing.
||[]|Use of Square Brackets ([ ]) is desirable, especially within code comments as the \ tag is not rendered in the VBA IDE, and to disambiguate between combined keystrokes and the [+] key. *Example in Code:* ` ' To break the execution of this function, Press [Ctrl]+[Break] or [Esc]` *Example Wiki:* To close Access immediately, press [Alt]+[F4]
|Text entry in fields||Enclose text entered by users with \` charachter (code formatting). *Example:* Type `Potato` into the **Desired Food** box.
|Referencing Field|**Bold**|To refer to a field, use **Bold** (Markdown= \**[stuff]**)
|Action||Generally, the action performed does not need to be highlighted. Instead, highlight the **Field** or the **Menu Item**. *Example:* Goto the **Options > Export** tab. Select desired **Sanitize Level**.
================================================
FILE: Wiki/Translation.md
================================================
The most recent version of this tool can provide translation support in the AddIn interface (not for your application).
See [Translations Issue](https://github.com/joyfullservice/msaccess-vcs-integration/issues/87) for more details.
# Options Translation Tab
**Note:** This tab is normally hidden.

|Setting *(Setting)*|Description
|-|:-:|:-
|**Contribute to Translations**|**Default: _On_**|Select this button if you wish to help manage translations.
|**Translations Path**|**Default: _[Blank]_**|Define the FOLDER path to the `*.pot` translation files.
|**Button _"Sync Files"_**||Click button to sync the database with the updated Translation files.
# Defining Translations in the AddIn
Translations for text are facilitated by calling `T()`. `clsTranslation` is the translation class facilitating language translation functions. `modObjects.T` is where `clsTranslation` is loaded.
|Input (Output) *(Optional Default Value)*|Description
|-|:-:|:-:|:-
|strText|`String`|**Required**|The text to be translated. Use variable tags to facilitate variable substitutions (such as file paths). Example: `T("Some String Translation Path: {0}",var0:=SomePath)`
|strReference|`String`|Optional _`vbNullString`_|
|strContext|`String`|Optional _`vbNullString`_|
|strComments|`String`|Optional _`vbNullString`_|
|var0|`Variant`|Optional|`{0}` substitution; converts to `String` for translation.
|var1|`Variant`|Optional|`{1}` substitution; converts to `String` for translation.
|var2|`Variant`|Optional|`{2}` substitution; converts to `String` for translation.
|var3|`Variant`|Optional|`{3}` substitution; converts to `String` for translation.
|var4|`Variant`|Optional|`{4}` substitution; converts to `String` for translation.
|var5|`Variant`|Optional|`{5}` substitution; converts to `String` for translation.
|var6|`Variant`|Optional|`{6}` substitution; converts to `String` for translation.
|var7|`Variant`|Optional|`{7}` substitution; converts to `String` for translation.
|var8|`Variant`|Optional|`{8}` substitution; converts to `String` for translation.
|var9|`Variant`|Optional|`{9}` substitution; converts to `String` for translation.
# Translation Definition
See `modObjects` for most up to date definition.
```VBA
'---------------------------------------------------------------------------------------
' Procedure : T
' Author : Adam Waller
' Date : 3/19/2024
' Purpose : Wrapper function to translate to current language
'---------------------------------------------------------------------------------------
'
Public Function T(strText As String, Optional strReference As String, _
Optional strContext As String, Optional strComments As String, _
Optional var0, Optional var1, Optional var2, Optional var3, Optional var4, _
Optional var5, Optional var6, Optional var7, Optional var8, Optional var9)
T = Translation.T(strText, strReference, strContext, strComments, _
var0, var1, var2, var3, var4, var5, var6, var7, var8, var9)
End Function
```
# Example Use of T()
In this example, the result of `T()` to a (fictitional) translation lanuage `ENG ALL CAPS` of `"Error with module: {0}"` would be `ERROR WITH MODULE: Some Cool Name"`.
```VBA
' Example Use of T()
Public Sub RunStuffOrNot()
Const FunctionName As String = ModuleName & ".RunStuffOrNot"
Dim strName As String
' All Kinds of code
strName = "Some Cool Name"
CatchAny eelError, T("Error with module: {0}", var0:=strName), FunctionName
End Sub
``` |**Default**
|**Default**
Show Advanced Printer Options...
 |**Default**
|**Default**
|**Default**
|**Default**
|Description
|-|:-
|***System Defaults***
|**Save as Default**|Save the current options as default for new projects. Anytime you export source and a `vcs-options.json` file does not already exist, it will use the default options you have specified.
|**Restore Defaults**|In the current project (open database), restore options to default values based on saved system defaults.
|**Clear Defaults**|Reset options to default the settings specified in the add-in source code. If you click this button, then the **Save as Default** button, it will reset all user customizations to the default options.
|**Open Install Folder**|Opens the directory the Addin is installed in. This can be handy to verify installation location, especially if your environment requires you to install in a non-standard location. See [Installation](https://github.com/joyfullservice/msaccess-vcs-addin/wiki/Installation) for more information.
|***Remove Add-In***
|**Uninstall**|Uninstalls the add-in from your user profile, including all saved defaults and encryption keys.
|**Default**
|Variable Type|**Required**