tags:

views:

808

answers:

2

I have an MsAccess 2003 application which is a dashboard to launching other MsAccess apps.

I employ the API ShellExecute to launch/open the MsAccess app as below:

lngReturn = ShellExecute(Application.hWndAccessApp, _
                            "Open", _
                            AccessMDBName, _
                            "", _
                            "C:\", _
                            SW_SHOWNORMAL)

When this code is deployed to a user's machine which only has MsAccess 2003 runtime installed, an error code =5 is returned when opening an MDB file >10MB I do not get any error for smaller MDB files.

Any idea what could be acting up?

+2  A: 

To me it seems unlikely (but nothing is impossible) that it's the 10MB file size. Are the files in the same place? The Errorcode=5 means access denied. As part of starting Access an ldb file has to be created or updated. Is it possible that your files are in a different location and the person does not have write access to the folder that contains the >10MB file? Is C:\ the location of the mdb file? Some companies have policies that restrict write access to the root of the C: drive.

bruceatk
A: 

The root of the C:\ is probably not writable to the user.

What you can do is remove the c:\ and it will use the current working directory. al la:

lngReturn = ShellExecute(Application.hWndAccessApp, _
                            "Open", _
                            AccessMDBName, _
                            "", _
                            "", _
                            SW_SHOWNORMAL)

It may be that for the smaller files (and 10MB isn't that large any more) that MS Access can get away without having to write anything to the working directory.

CodeSlave
Er, no, the LDB file has to be written no matter how large or small the MDB is.
David-W-Fenton