Version control for VBA file

后端 未结 4 1729
孤街浪徒
孤街浪徒 2020-12-11 11:13

I have a huge MS Access document with built-in VBA codebase. Is it possible to track the file (as I am developing it) with a (mercurial) version control system? Can I extrac

相关标签:
4条回答
  • 2020-12-11 11:18

    It's possible with MS Access to export most of the code through scripts. I posted some here a while ago:

    How do you use version control with Access development?

    0 讨论(0)
  • 2020-12-11 11:21

    There is a nice tool here https://github.com/hilkoc/vbaDeveloper .

    It allows you to easily export and import all your vba code and can do this automatically as soon as you click 'save'. The export files are all plain text which you can then put in version control in the usual way.

    0 讨论(0)
  • 2020-12-11 11:23

    It's possible to version-control binary files, but it would be a little cleaner (IMO) to have the code separate. If it works for you though, then by all means do what you do.

    0 讨论(0)
  • 2020-12-11 11:26

    Access all the way up to 2010 has supported source code control, and that includes support for team foundation server. The fact that you place all files in ONE zip file, one folder on a hard drive, or one container called an accDB is a MOOT point. As long as EACH individual object can be viewed as a SEPARATE object, then why do you care if one is using a zip file, or an accDB file? This is a “logical” view vs a physical view issue.

    The simple matter is EACH OBJECT IN ACCESS CAN BE EXPORTED AS A TEXT OBJECT. Thus Access has supported source control integrate using this ability with the standard Microsoft SCC interface since Access 97 (that is 17+ years!!).

    When you use SCC such as Visual Source safe or Team Foundation server then the BUILT IN UI in Access supports display the objects status in question. You have resolution down to the form, report, sql query and code module level. So multiple developers can all work on the application at the same time. They only need check out the forms, reports quires etc. they are working on. Each developer thus has their own local build.

    If using Visual Source Safe, then you see this in the ribbon:

    enter image description here

    If you using team foundation server, then you see this:

    enter image description here

    And for objects checked out, you see this:

    enter image description here

    And when you open, or even right click on an object, you see these additional options:

    enter image description here

    Of course given that “few” use this feature or even know what it is (and the posts on SO confirm this lack of knowledge), then it is LITTLE surprise that the feature was dropped in Access 2013 after all these years!. However some 3rd party add-ins claim to restore this ability. So the ability to export objects in 2013 as individual text files STILL remains in place.

    0 讨论(0)
提交回复
热议问题