Why won't SQL Server Agent GetObject or CreateObject.
I have a scheduled Job that runs a DTS Package which runs an executable
which uses GetObject and CreateObject to connect to an instance of Solid Edg
e
software. It works fine if I run the DTS manually. It doesn't work if I ru
n
the Job.
I know about RunAs.exe but can't use it because it prompts for a password.
This is the code that connects to the software;
________________________________________
__
'Connect to a instance of Solid Edge.
Set objSEApp = GetObject(, "SolidEdge.Application") 'It was already open
If Err Then
Err.Clear
Set objSEApp = CreateObject("SolidEdge.Application") 'It wasn't open
booSEAppWasOpen = False
Else
booSEAppWasOpen = True
End If
objSEApp.Visible = False
objSEApp.DisplayAlerts = FalseCheck the account that SQL Server Agent runs under. From here it looks like
that account doesn't have the permissions needed. If you run the DTS
manually, it will run under your account, not under the SQL Server Agent
account.
Jacco Schalkwijk
SQL Server MVP
"Matt Sonic" <MattSonic@.discussions.microsoft.com> wrote in message
news:84D203EE-7C3B-4218-A5EA-D2328EC2F02D@.microsoft.com...
> Why won't SQL Server Agent GetObject or CreateObject.
> I have a scheduled Job that runs a DTS Package which runs an executable
> which uses GetObject and CreateObject to connect to an instance of Solid
> Edge
> software. It works fine if I run the DTS manually. It doesn't work if I
> run
> the Job.
> I know about RunAs.exe but can't use it because it prompts for a password.
> This is the code that connects to the software;
> ________________________________________
__
> 'Connect to a instance of Solid Edge.
> Set objSEApp = GetObject(, "SolidEdge.Application") 'It was already open
> If Err Then
> Err.Clear
> Set objSEApp = CreateObject("SolidEdge.Application") 'It wasn't open
> booSEAppWasOpen = False
> Else
> booSEAppWasOpen = True
> End If
> objSEApp.Visible = False
> objSEApp.DisplayAlerts = False
No comments:
Post a Comment