Calling Runtime Access using VBA

G

Guest

I wish to launch a new Access application from another using VBA code.
This is dead simple except I don't know how find the Runtime MSAccess.exe
file on users PC's. Accordingly I'm simply launching the application and
letting users systems find MSAccess. Unfortunately, if they already have
previous versions of Access, the application will be launched using that,
incorrect, version and crash.
As the application, together with Runtime Access, will be distributed to
many users using the Packaging Wizard, I understand that Runtime Access may
be stored in different locations depending upon which O/S users have.
Accordingly, hard coding a path to the MSAccess.exe wouldn't work.
Any ideas - thanks.
 
A

Albert D. Kallal

Well, if there was NO issues what version of ms-access, then you could
simp.y launch ANY program
via

application.FollowHyperlink "path name to mdb/mde"

Application.FollowHyperLink "c:\data\test.pdf"

The above would launch a pdf file.
Unfortunately, if they already have
previous versions of Access, the application will be launched using that,
incorrect, version and crash.
As the application, together with Runtime Access, will be distributed to
many users using the Packaging Wizard, I understand that Runtime Access
may
be stored in different locations depending upon which O/S users have.
Accordingly, hard coding a path to the MSAccess.exe wouldn't work.
Any ideas - thanks.


If you are running multiple versions of ms-access, then ALL OF the many
many problems exist. The runtime does not change this issue. So, don't be
under ANY impression that the runtime allows you a install that is DIFFERENT
then walking on to that persons computer and installing a FULL version of
ms-access. The last version of ms-cess run on your machine will thus
associate ALL mdb/mde files on the computer...including THEIR EXISTING ones.

Anyway, to launch another, you can grab the path name to ms-access as
follows:

' path to maces is required here
strShellProg = q & SysCmd(acSysCmdAccessDir) & "msaccess.exe" & q & " "

strCurrentDir = CurrentProject.path & "\"

' path to current dir...and upgrade...
strShellProg = strShellProg & q & strCurrentDir & "UpGrade.mde"

Shell strShellProg, vbNormalFocus

So, note the above command to get the path name to the CURRENTLY running
ms-access.

The above thus shows you in code how to grab the path name, but it certainly
solves NONE of your problems of running more then one version of ms-access
on a machine. IF you not regularly run multiple versions of ms-access on
your computer, then you are likely not ready to un-leash running multiple
versions of ms-access on a users computer. As mentioned, installing
ms-access, or the runtime is simply installing another version of ms-access
on the target computer, and all of the MANY problems will exist.

The runtime only makes sense when there is NO VERSION of ms-access on the
target machine. If ms-access is going to be already installed, then a
CONSIDERABLE amount of caution needs to be taken...

You might consider using sagekey for you installs.

www.sagekey.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top