Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2005

Tip: Looking for answers? Try searching our database.

Running a Com object from a Web or Windows Service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eddie D - 17 May 2005 18:22 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.