Home All Groups Group Topic Archive Search About

Running Software from SQL Server/ DTS Package / Job Schedule

Author
13 May 2005 2:01 PM
Matt Sonic
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

Author
13 May 2005 2:54 PM
Jacco Schalkwijk
Check 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


Show quote
"Matt Sonic" <MattSo***@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

AddThis Social Bookmark Button