potluri
potluri

Reputation: 25

The ForEach Loop Enumerator is Empty - SSIS Error when executing through CMD via VBA

I am currently working on a SSIS package that is to be triggered through CMD via VBA (Access). All that the package does is read a bunch of files from a folder and upload them into a table in SQL Server. The tricky part comes is that this folder location from which the package is to read the files is dynamic. Thnaks to STACKOVERFLOW, I figured out a way to make it dynamic, and the package is working good when executed from MS VS2008.

FUN PART : As the final link to complete the chain, I have used following in the cmd

dtexec \f "C:\Desktop\SSISAppend.dtsx" /Set "\Package.Variables[User::Directory].Property[Value];C:\Desktop\AppendFiles"

Throwing out an error : Code : 0x8001C004 Description: The For Each File Enumerator is empty. The For Each File enumerator did not find any files that meatched the file pattern, or the specified directory was empty.

I have used the following variables: "Directory" against DIRECTORY in COLLECTION>>EXPRESSIONS in the ForEachfile Enumerator, "FilePath" (With Index 0) in the Variable Mappings

When executed through MS VS2008, the package is running good with watever location mentioned against the variable DIRECTORY.

Appreciate all the help and do let me know if you need further info.

Upvotes: 0

Views: 1805

Answers (1)

Tak
Tak

Reputation: 1562

Thinking on the same lines as @Joost comment with regards to permissions through Access/CMD.

Maybe you can try using RUNAS when starting CMD.

Using RUNAS command http://technet.microsoft.com/en-us/library/cc771525.aspx :

Upvotes: -1

Related Questions