DTS pkg works manuelly but fails when scheduled

  • I've created a DTS pkg that exports data to a excel spreadsheet. When I kick it off manuelly it works fine. However when I schedule it through the DB it fails with the following error:

    Error string: The Microsoft Jet database engine cannot open the file '\\Mcphwkfg\c$\tester.XLS'. It is already opened exclusively by another user, or you need permission to view its data. Any suggestions would be appreciated.

  • It appears that the SQL Server Agent does not have permissions to gain access of the Excel file where you do. When you run the package manually you are passing through your security context however, when the job is run on a schedule it is passing through the security context of of the SQLServerAgent service.

    Hope this helps.

    David

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • I added the SQL Server Agent system account to the domain Administrators group and added it to the Excel file itself with full control rights. I'm still getting the same error.

  • scotttr,

    You need to delete the file before create it again OR the file is open when you are using DTS OR if ypu want to add data to an excel file you need to create a new worksheet.

    Johnny...

  • Could you chk the SQL Server agent connection.Is it running under windows authentication or SQL Server authentication.Try with the SQL Server SA a/c or the SQL A/c who has the sysadmin permissions.

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

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