views:

43

answers:

0

Specifically, I'm running into this.


I want to call a function that resides in a MS-Access mdb file. Unfortunately, the box that it's going to be run from (Windows Server 2003) does not have Access installed on it.

I installed the runtime environment onto it just fine and it can open up the file normally and everything, but it can not be run from the VBScript. The script looks something like this:

dim accessApp
Set accessApp = createObject("Access.Application")
accessApp.OpenCurrentDataBase("C:\Program Files\example\example_application.mdb")

accessApp.Run "testFunction"
accessApp.Quit
Set accessApp = nothing

The script errors on Line 2 with the following complaint

ActiveX component can't create object: 'Access.Application'

I looked up the error and I foudn that it's compalining about the registry values that aren't installed with the runtime that associate the Access.Application call with that program. I didn't feel safe copying over the files and I ran into another little problem.

Even if I was able to open the file in the VBScript as above, the application would close immediately anyway since it wouldn't have a mdb associated with it to run with (because it's using the run-time distribution).

So, there are two issues at hand. Is there a way around these issues? Can I open the application in a separate way and then call that function in the VBA code?