Book a Demo

Author Topic: Error Using COM Object from Scheduled Task  (Read 3345 times)

Jeff Odell

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Error Using COM Object from Scheduled Task
« on: May 16, 2006, 04:15:47 am »
I've integrated the EA COM object with .Net and MSBuild and use it to generate web sites and reports from various Packages in our Access-based model file.

The build runs fine from the command line on my Windows XP SP2 box and on our Windows 2003 R2 build server.

However, when I scheduled the job on the Windows 2003 box via the windows scheduler, it fails when it runs unattended at night.

The following error appears in my log file:

Retrieving the COM class factory for component with CLSID {3A9E4F92-8D27-495B-8B22-1D702B3F0C83} failed due to the following error: 80080005.

If I log in and run it from the scheduler, it works.  It appears to need the login for some reason, although I gave the scheduled job the same login credentials.  

There are some errors out there about this popping up when using automation in Microsoft Office products but no clear solutions.

Has anyone run in to this error and conquered it?

TIA - jlo

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Error Using COM Object from Scheduled Task
« Reply #1 on: May 16, 2006, 04:55:47 am »
Jeff,

That error code is returned by Access (among other Office components) as kind of a general purpose error. It is often associated with privilege or locking violations.

You may be opening the file in a non-shared mode, and then getting into trouble if another thread, or even another portion of your application opens it again. This could potentially happen because of the threading model on your server.

Your server account may or may not use the credentials you have set up. In particular, IIS and ASP (.Net or otherwise) do not always use the credentials of a user, but supply their own. You may be able to handle this in .Net by explicitly switching credentials in code before touching EA, then switching back to handle the non-EA portions of your application logic.

Not a solution I know, but worth checking into.

David
No, you can't have it!