I have a bit of a problem I'm hoping someone can shed some light on...
I have a VB.Net console application written in VS 2003 that produces a .exe file that now sits on a Windows 2000 server directory. This exe does the following 3 things:
1.) Using the VB Interaction SaveSetting() method, it programmaticall y updates the system registry under the HKEY_CURRENT_US ER\SOFTWARE key and saves a directory location used by a PDF driver (so that the pdf driver does not prompt for a location).
2.) opens up an instance of a local MSAccess database (i.e., set objAccess = New Access.Applicat ion(c:\mydataba se.mdb))
3.) Uses the DoCmd.OpenRepor t method to create a physical .pdf report to the location specified above in step 1. Then the report is emailed out to a group of users.
When I'm logged on to the Windows 2000 server as my user i.d. and I double click the .exe file, everything works perfectly.
However, I'm running into problems when trying to automate this and kick off the .exe file with a Windows scheduled task. If I run the scheduled task as my i.d., I do not get past step 2 above as it keeps giving me the following error:
"System.Unautho rizedAccessExce ption: Access is denied." It appears that my userID cannot create a new instance of MSAccess but only when run through the scheduled task.
If I run the scheduled task as NT AUTHORITY\SYSTE M, I get an error message on step 3 above with the following error message:
"There was a problem retrieving printer information for the Win2PDF on PDFFILE:. The object may have been sent to a printer that is unavailable."
In this case it appears that I cannot save registry settings as the NT AUTHORITY\SYSTE M user for the pdf printer.
So my questions are first, does anyone know why I cannot create an instance of MSAccess when using the scheduled task. And second, why can't I save registry settings when I run the .exe through a scheduled task as the NT AUTHORITY\SYSTE M user?
Thanks in advance,
John
I have a VB.Net console application written in VS 2003 that produces a .exe file that now sits on a Windows 2000 server directory. This exe does the following 3 things:
1.) Using the VB Interaction SaveSetting() method, it programmaticall y updates the system registry under the HKEY_CURRENT_US ER\SOFTWARE key and saves a directory location used by a PDF driver (so that the pdf driver does not prompt for a location).
2.) opens up an instance of a local MSAccess database (i.e., set objAccess = New Access.Applicat ion(c:\mydataba se.mdb))
3.) Uses the DoCmd.OpenRepor t method to create a physical .pdf report to the location specified above in step 1. Then the report is emailed out to a group of users.
When I'm logged on to the Windows 2000 server as my user i.d. and I double click the .exe file, everything works perfectly.
However, I'm running into problems when trying to automate this and kick off the .exe file with a Windows scheduled task. If I run the scheduled task as my i.d., I do not get past step 2 above as it keeps giving me the following error:
"System.Unautho rizedAccessExce ption: Access is denied." It appears that my userID cannot create a new instance of MSAccess but only when run through the scheduled task.
If I run the scheduled task as NT AUTHORITY\SYSTE M, I get an error message on step 3 above with the following error message:
"There was a problem retrieving printer information for the Win2PDF on PDFFILE:. The object may have been sent to a printer that is unavailable."
In this case it appears that I cannot save registry settings as the NT AUTHORITY\SYSTE M user for the pdf printer.
So my questions are first, does anyone know why I cannot create an instance of MSAccess when using the scheduled task. And second, why can't I save registry settings when I run the .exe through a scheduled task as the NT AUTHORITY\SYSTE M user?
Thanks in advance,
John
Comment