Error when using xp_cmdshell to Invoke DTS package

  • Hi,

    I have a DTS apckage which used ActiveX script to open an Excel application using

    CreateObject("Excel.Application")

    This statement is failing when i execute the DTS package using xp_cmdshell stored proecdure..

    the error meesage is

    Error Description: ActiveX component can't create object: 'Excel.Application'

    But the package works fine when i execute dtsrun from the command line.

    Please help me in solving this issue.

  • Joe,

    When you are using xp_cmdshell is the user that invokes that command the same as you?  i.e are you using trusted connection i.e. YourDomain\Joseph when you log in to QA or are you using a SQL Login i.e. sa ??

    It sounds like a permissions problem so far.  You are invoking the DTS package as you from the command prompt but through the DTS package or QA are running with different credentials which don't have permission to create the Excel file

     

    Good Luck



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • Thanks Ahren,

    I am not using a trusted connection. QA is logged with the same userID (the package owner is logged in)

    I am passing the user ID & password as parameter to the dtsrun.

     

    For me it looks like problem while creating Createobject com componenet.

    Could you tell me when we run the DTS package using xp_cmdshell is the package is executed in server or the client?

    Thanks

    joe

     

  •  

    xp_cmdshell runs on SQL Server Machine, It runs under the same security account as used as sql server startup (services).

     

    so check if Excel is available on server and the startup accoun of Sql server has permissions for the same..

     

     


    -- Amit



    "There is no 'patch' for stupidity."



    Download the Updated SQL Server 2005 Books Online.

  • Thanks Amit,

    Yes i got the problem. xp_cmdshel runs in server and i don't have excel in server. SO i think i should not use Excel automation in my DTS since i canot have excel application in Server. Do i need Excel application installed in server for using automation or some dll file registration will be enough?

     

    Thanks

    joseph

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply