How do I find the path to msaccess.exe without using Access?

A

A C

Hi

We need to make a console app (exe) in c++ which will open a MS Access
database with certain input parameters (wrkgrp file, username and pw). As
part of this we need the path to msaccess.exe, which may be different on
different machines and different for different versions of Access.

In Access I used to get this info using the code SysCmd(acSysCmdAccessDir),
but as we are not using access (we will be using c++) I cannot use this
function.

Can someone give me some help here?

Thanks
AC
 
B

Brendan Reynolds

There's an example at the following URL that calls the API function
FindExecutableA in Shell32.dll. The example is in VBA, so you'll have to
translate. Alternatively, now that you know the name of the API function to
look for, doubtless there are C++ examples out there somewhere.

http://www.mvps.org/access/api/api0023.htm
 
Top