I've got a working WINFORM application that I'm trying to convert to a
Service (either Windows or Web).
Objective is to open Microsoft Access / Run a Report to Disk / Close Access.
(KB article q317113). My problem is that certain lines of code result in
errors and not sure how to work around it. I think it is because there is no
"user interface".
dim oAccess as access.application
shell("c:\...msaccess.exe" dbname / startup options ...) ' Open database
' Move focus back to here to force App to register in ROT
AppActivate(Title:=me.title) <== Can't get this to work?
' wait then Retrieve instance using the dbname
system.threading.thread.sleep(10000)
oAccess = getobject(dbname) <== returns nothing
In a nutshell, the strategy is to create an instance of Access and retrieve
the instance using the database I've requested as an object. In the interem,
the AppActivate is used to force the application to register itself in the
ROT. In WINFORM, the me.title refers to the FORM. What should I use from
within a service. Tasklist does show Access starting.
the following code generates the following error
dim oAccess as object
oAccess = createobject("Access.Application")
429: Cannot create ActiveX component.
Any ideas / direction would be much appreciated

Signature
Ed
Chad Z. Hower aka Kudzu - 18 May 2005 08:45 GMT
"=?Utf-8?B?RWRkaWUgRA==?=" <EddieD@discussions.microsoft.com> wrote in
news:FC7DCB6A-F1BF-47DA-B7CD-4B5869133B7A@microsoft.com:
> dim oAccess as object
> oAccess = createobject("Access.Application")
>
> 429: Cannot create ActiveX component.
>
> Any ideas / direction would be much appreciated
Its likely permissions. But that being said, using Access in a server
environment, especially as you do is a recipe for disaster. You should find
an alternate way to run these reports.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Blog: http://blogs.atozed.com/kudzu