Cannot delete excel source file.

  • I'm running a DTS import from Excel to SQL server. Everything works fin except I cannot delete the source file when running the entire package. When running only the deletion step everything works fine but if running the entire package I get an acces violation error. It's probably due to the excel file not being released after being used as source file. How do I fix this progammatically?

    Thanx in advance.


    ------------------------------------------

    Did you know that if you don't drink your milk every morning, the Arla-rabbit will come and shoot you in the head, or sometimes in the belly?

  • Are you connecting to excel through an activex script?

    If so, make sure you set the object to nothing at the end.

    Is it just a normal package of excel source and sql server db destination?

    If so, put in a step to copy the spreadsheet to your server locally before import and then use that file for the import. That way you never loack the source file in the live environment. I don't know why it would be locking anyway if this is the case.


    ------------------------------
    The Users are always right - when I'm not wrong!

  • Is your Excel -> SQL transfer a datapump task? If so, make you turn on the "Close connection on Completion" option in the workflow properties of the task.

     

    --------------------
    Colt 45 - the original point and click interface

  • Thanks phillcart that fixed my problem. I should have been more specific as to which type of task it was.

    Cheers


    ------------------------------------------

    Did you know that if you don't drink your milk every morning, the Arla-rabbit will come and shoot you in the head, or sometimes in the belly?

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

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