Version Control System for Microsoft Access
Go to file
Lukas Ziegler 31c4101527 change warning 2021-03-09 07:43:22 +01:00
LICENSE Initial commit 2021-03-06 13:27:04 +00:00
README.md „README.md“ ändern 2021-03-06 13:49:23 +00:00
compose.vbs change src folder and data argument 2021-03-08 13:06:04 +01:00
decompose.vbs change warning 2021-03-09 07:43:22 +01:00

README.md

Version Control for MS Access

Scripts from https://stackoverflow.com/questions/187506/how-do-you-use-version-control-with-access-development

decompose.vbs

You can execute this script by calling cscript decompose.vbs <path to file to decompose> <folder to store text files>. In case you omit the second parameter, it will create 'Source' folder where the database is located. Please note that destination folder will be wiped if it already exists.

Include data in the exported tables

Replace line 93: oApplication.ExportXML acExportTable, myObj.Name, , sExportpath & "\" & myObj.Name & ".table.txt"

with line oApplication.ExportXML acExportTable, myObj.Name, sExportpath & "\" & myObj.Name & ".table.txt"

compose.vbs

Text-file only solution (queries, tables and relationships included) I have altered the Oliver's pair of scripts so that they export/import relationships, tables and queries in addition to modules, classes, forms and macros. Everything is saved into plaintext files, so there is no database file created to be stored with the text files in version control.

You can execute this script by calling cscript compose.vbs <path to file which should be created> <folder with text files>. In case you omit the second parameter, it will look into 'Source' folder where the database should be created.

Import data from text file

Replace line 14: const acStructureOnly = 0 with const acStructureOnly = 1. This will work only if you have included the data in exported table.

Things that are not covered

  1. I have tested this only with .accdb files, so with anything else there might be some bugs.
  2. Setting are not exported, I would recommend creating the Macro that will apply the setting at start of the database.
  3. Some unknown queries sometimes get exported that are preceded with '~'. I don't know if they are necessary.
  4. MSAccess object names can contain characters that are invalid for filenames - the script will fail when trying to write them. You may normalize all filenames, but then you cannot import them back.

Other solution

https://github.com/msaccess-vcs-integration/msaccess-vcs-integration