0

I'm the new maintainer of an application that was previously done by a contractor. The application was developed using VBA inside an Access project. It consists completely of forms (one of which is opened using autoexec macro) and stuff like click handlers. I don't see any use it makes of Access functionality except for accessing the tables using ODBC table linking done in Access. These are the reasons I would like to convert this application to a standalone application if possible:

  • There is no version control at all, just multiple copies of the same project with an incrementing number appended to the filename
  • The VBA IDE is super annoying
  • I think the code could then be migrated to more modern languages like C# or VB.net making it more maintainable

Is there any way to convert this to a separate Windows application (I guess using WinForms as that seems to be the same as the forms in VBA) that can be maintained in Visual Studio?

Gustav
  • 53,498
  • 7
  • 29
  • 55
  • 1
    I think it would take a rewrite. I don't know of any tool to automate conversion. A lot of the code might be able to be reused though. – Dave Clough Mar 10 '17 at 15:36
  • 1
    `Is there any way to convert this to a separate Windows application` well you would need to develop the new application in whichever environment you choose.. there's no way of "converting" the code. – luke_t Mar 10 '17 at 15:36
  • Yep, trash and rewrite is what to do. – Gustav Mar 10 '17 at 15:58
  • Okay that's annoying. I was under the impression that Winforms applications could be written in VB6 and maybe there was some easy way to convert between the 2. – Billion Dollar Mistake Mar 10 '17 at 16:28
  • 1
    You can add versioning control quite easily to an access database. Form creation and data control / validation is much quicker to develop in Access VBA than Winforms, with no where near as much coding required. I agree the IDE isn't brilliant but a couple of free tools make it much more usable. Familiarity makes the biggest impact. – Minty Mar 10 '17 at 16:47
  • How do you version control Access VBA? I found [this](https://github.com/timabell/msaccess-vcs-integration) but it's more of an hack to be able to use version control, even using undocumented functions so might break at any time – Billion Dollar Mistake Mar 10 '17 at 17:09

1 Answers1

2

Access for 20 years has supported the standard ‘Microsoft source code control interface. This is outlined in this post:

Version control for VBA file

And this one here:

How to implement version control in Access 2003?

There really little or no reason why Access + VBA, or vb.net can’t be used with source code control. However the SCC add-in that was part of Access was depreciated in 2013. So for versions after 2010, then you can use a script to export the objects. This works quite well – I am using GitHub with Access. So you need a script to export objects now that the SCC add-in is not included in versions beyond 2010 and it works rather well. Access can view each object as "logical" separate. So having all parts in a folder, a zip file, or the Access continuer is moot - don't fall for the physical vs logical concept here that so many people fail to grasp.

•The VBA IDE is super annoying

Hum, never really had much issue with it. I spend good parts of my day using VS2013 and vb.net, but for the most part the VBA IDE is fine for most Access applications. Can you give an example of what feature or something that you find bad with the VBA IDE?

•I think the code could then be migrated to more modern languages like C# or VB.net making it more maintainable

I can’t see why code written in c++, or Pascal or VBA is going to be more or less maintainable? You have to give an example of what you mean here? Maintainable code is maintainable if it is COBOL, Pascal, or VBA.

I guess using WinForms as that seems to be the same as the forms in VBA

No, Access does not use winforms.

Access as a developer tool not really different then say using FoxPro, or say Delphi. Such code and systems can be re-written like any other software development system would require that I am aware of say in the last 30 years of desktop development.

As a general rule, something written in say Delphi, or Access + VBA is not going to by some act of magic is going to be converted to WinForms and .net. That goes for just about any IDE and system I am aware of.

So software in the general computer industry never worked this way in the past, and thus Access is really much the same as most everything else in this regards.

Community
  • 1
  • 1
Albert D. Kallal
  • 42,205
  • 3
  • 34
  • 51
  • > No, Access does not use winforms. So this is where I was wrong then. I was thinking it was Winforms and thus could be extracted from VBA (as Winforms and VB6 both are available outside VBA). I found [this commercial project](http://www.microtools.us/_product.aspx) online that seems to be doing a conversion as I imagined it by doing a source-to-source translation. It looks interesting but I think I will try to maintain the project as-is for a while. – Billion Dollar Mistake Mar 13 '17 at 10:53