Database - If my program uses an Access database, do my users need Access installed?
The answer is probably not. I say probably, because it depends on what you are doing:
If you use the Access object model in any way (code like: "Dim MyApp as Access.Application", or equivalent), possibly for showing reports, then they do need it.
If you only use the data from the tables (via ADO/DAO/...) then they do not need it.
I only use the data, so they don't need Access.. I dont need to do anything!
Not quite, whilst they do not need Access itelf, they do need some software installed which actually works with the file. Depending on various factors (such as version of Windows, and other installed software), your users might have this installed already, but then again they might not!
There are two different things which you will probably need to install, MDAC (Microsoft Data Access Components) and Jet or ACE drivers (the software which actually interacts with the .mdb file). Both of these are freely available, and can be downloaded from Microsoft, links for them can be found here.
Depending on which software you are using to create your installation package, you may be able to get these to install with your program (otherwise you will need to install them separately).
They do need Access, so how do I install it with my program?
The answer is simple.. you dont.
Access is not something you are allowed to distribute just because your program uses it - you (or your users!) need to purchase a licenced copy for each computer that it will be used on.
Even if you do have the appropriate licenses, the installation of Access is not something that should be integrated into the installation of your program, as it needs lots of user intervention, and is big/complex enough to be likely to have errors (which may be after your program is installed safely - so will have problems when they try to re-install).
What happens if my program uses the Access object model, but the user doesn't have Access installed?
Your program will not work.. but with a little bit of effort you can change the code to Late Binding, which means that the rest of the program can work, and only some parts will fail (with a little error handling, this can be with 'nice' messages and the program continuing afterwards).
An explanation of how to use Late Binding can be found here. This describes the method for Excel, but the method is exactly the same for Access (just replace the word "Excel" in the text with the word "Access"!).
Last edited by si_the_geek; Jan 15th, 2009 at 10:30 AM.