For Each Loop Variable Causing Package to Fail

  • I've set up an SSIS package to import a rake of Excel files as a 'one off' upload. I've used a For Each loop to go through the folder containing the files and yesterday it worked fine. I've subsequently made a couple of minor changes and now the filename variable doesn't seem to be working. When I attempt to run the package using the loop I get:

    "The Microsoft Jet database engine cannot open the file 'C:\....'. It is already opened exclusively by another user, or you need permission to view its data".

    When I run the package for each file individually it works as it should. Can anybody shed any light on this please? If you need any more information please just ask.

    Thanks.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Is there a chance that anyone (or even you) has one of the files open in Excel?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin (12/13/2013)


    Is there a chance that anyone (or even you) has one of the files open in Excel?

    Thanks Phil, that was the first thing I thought but no. I'm working locally, the files are sitting are sitting in a folder on my desktop and I've not even got Excel open, let alone the files.


    On two occasions I have been asked, "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" ... I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
    —Charles Babbage, Passages from the Life of a Philosopher

    How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537

  • Between loops you might add like a second or two delay, I've seen some locking of the file resolve itself this way..

    CEWII

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

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