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.
I figured out a way to make it dynamic, by using variables
I have used the following variables:
"Directory" against DIRECTORY in COLLECTION>>EXPRESSIONS in the ForEachfile Enumerator,
"FilePath" (With Index 0) in the Variable Mappings
PROBLEM : As the final link in the chain, I have used following to be triggered from VBA
dtexec \f "C:\Desktop\SSISAppend.dtsx" /Set "\Package.Variables[User::Directory].Property[Value];C:\Desktop\AppendFiles"
When I try to execute the package using the above command, it gives out the 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.
But, when I run the package from MS VisualStudio 2008, the package runs fine, takes the location of the file assigned to the variable "Directory". 
All help is appreciated

Where are you executing the package from? You're giving an aboslute path so this will work only if package as well as the folder is in the same machine from which you execute the above code. Otherwise you need to use UNC path.
Another thing to check is what login is executing the command and you need to ensure it does have access to the directoty path as well as to the path where package resides.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Package giving error when executed through bat file

    The packages successfully execute in SQL Server Data Tools but when I use DTEXEC to execute it gives me the following error:
    "To run a SSIS package outside of SQL Server Data Tools you must install Send Mail Task of Integration Services or higher .
    I tried 5 different packages and all of them showed similar error except the send mail task is replaced by different other tasks of those packages.

    Go to start-> run
    Type Services.msc. It will launch services window.
    Check for a service named SQL Server Integration Services with or without version number. If its present it means SSIS is installed. Also make sure its started and is in running state.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Error when execute a package from SQL Server Agent

    We have the next problem:
    When we execute a package from a Job of SQL Server agent, it shows the success messege, but reviewing the results, the package didnt do all the tasks.
    When we run it mannually by MSIS the package, it shows the success message and it works fine.
    The workflow of the package is :
    1) Shrink the databases (executing a sql file)
    2) Backup the databases (Back up Database task of MSIS)
    3) Rename the files to .BAK extension (by the Foreach loop container and fyle system task)
    4) Execute command to compress the it (by a .bat)
    5) Move the compress file to another location  (by another Foreach loop)
    Manually run correct, but when is a a SQL AGent Job that execute the package it does only the first 2 steps.
    we are ussing Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) Jun 17 2011 00:54:03 Copyright (coffee) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) 
    We are using a user with administrator privilegies
    Cheers 

    Can you check if account running package has proper access. You may need to define a proxy account for that.
    See
    http://www.databasejournal.com/features/mssql/article.php/3789881/Proxy-Accounts-in-SQL-Server.htm
    http://gqbi.wordpress.com/2014/01/30/setting-up-a-proxy-account-to-run-sql-server-integration-services-ssis-2012-packages/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Error when executing external workflow process

    OWB 9.2 with server on Windows NT.
    I can successfully execute a mapping workflow process from the deployment manager, but I get an error when executing a simple external process:
    command: move
    parameters: ?c:\\data\\owbtest\\src.txt?c:\\data\\owbtest\\trg.txt
    Resulting output:
    Create Process: move c:\data\owbtest\src.txt c:\data\owbtest\trg.txt error=2
    File c:\data\owbtest\src.txt exists.
    My questions:
    1. What am I doing wrong?
    2. What does error=2 mean? Is this a Windows error?
    3. Do I have to configure some location for the process? What does 'use default location' mean for the configuration property Working Location? Is a host-logon performed before the host-command is executed?
    4. Is there logging available for an external process? In the workflow tables or views?
    5. I can't find much documentation for these questions. Is there more documentation than the OWB user guide and the OWF guide?
    Jaap.

    It seems that commands that are not an executable in some directory, but are part of the Windows kernel (like 'move'), need to be started as a parameter of the cmd command. I did this and now it works fine.

  • UnPivot in the foreach loop container

    Hi
    I would like to "unpivot" SEQUENTIALLY each row in a table
    Before the pivot task in the foreach loop container how to read sequentially each row ?
    1/ from a PK ?
    2/ from parameters with a WHERE field1 = ? and field2 = ? and field3=?....
    These parameters have been set up prevoiouly in the loop
    3/ Others ? ...
    Thx for your help

    Hi Gilles,
    To achieve your goal, you can simply use the Unpivot Transformation or UNPIVOT statement in T-SQL.
    If you want to use Unpivot Transform, it should be configured as follows:
    If you want to use T-SQL, the query is like below:
    SELECT u.Name, u.Category
    FROM [dbo].[MyTable]
    UNPIVOT
    (Name for Category in (Field1, Field2, Field3)) u
    References:
    http://dinesql.blogspot.in/2011/08/pivot-and-unpivot-integration-services.html
    http://technet.microsoft.com/en-us/library/ms177410(v=sql.105).aspx
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • After upgrade SP-Crawl Error: The SharePoint item being crawled returned an error when attempting to download the item.

    Hi All - After the upgrade, I am getting SP-Crawl Error for certain links. I check the Crawl component has proper permission.
    Google is showing some article like
    http://blog.karstein-consulting.com/2012/04/20/error-in-crawl-log-the-sharepoint-item-being-crawled-returned-an-error-when-attempting-to-download-the-item/
    not sure if this resolution is referring to 2010 and/or 2013. 
    I checked the registery editor. I couldn't find 14.0 under the Office Server.
    Any clue?
    Regards,
    Khushi
    Khushi

    I checked the web application policy the search crawl account has full read permission.
    Crawl
    Fiddler
    Log Error referring the Correlation ID
    01/06/2014 13:05:06.14  w3wp.exe (0x1698)                        0x0118 SharePoint Foundation        
     Monitoring                     nasq Medium   Entering monitored scope (Request (GET:/sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD)).
    Parent No 
    01/06/2014 13:05:06.14  w3wp.exe (0x1698)                        0x0118 SharePoint Foundation        
     Logging Correlation Data       xmnv Medium   Name=Request (GET:<SiteURL>/sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD) e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.14  w3wp.exe (0x1698)                        0x0118 SharePoint Foundation        
     Authentication Authorization   agb9s Medium   Non-OAuth request. IsAuthenticated=True, UserIdentityName=, ClaimsCount=0 e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.15  w3wp.exe (0x1698)                        0x1738 SharePoint Foundation        
     General                        af71 Medium   HTTP Request method: GET e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.15  w3wp.exe (0x1698)                        0x1738 SharePoint Foundation        
     General                        af75 Medium   Overridden HTTP request method: GET e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.15  w3wp.exe (0x1698)                        0x1738 SharePoint Foundation        
     General                        af74 Medium   HTTP request URL: /sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.17  w3wp.exe (0x1698)                        0x1738 SharePoint Foundation        
     Files                          aise3 Medium   Failure when fetching document. 0x80070090 e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.17  w3wp.exe (0x1698)                        0x1960 SharePoint Foundation        
     Monitoring                     b4ly Medium   Leaving Monitored Scope (Request (GET:<SiteURL>/sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD)).
    Execution Time=20.5461867360237 e8b1679c-0476-70d4-9fcd-2cef5be44461
    01/06/2014 13:05:06.17  w3wp.exe (0x1698)                        0x1960 SharePoint Foundation        
     Monitoring                     b4ly Medium   Leaving Monitored Scope (Request (GET:<SiteURL>/sites/HR/Shared%20Documents/Benefits/Insurance%20Benefits/Life%20Insurance/Basic%20Life%20and%20ADD)).
    Execution Time=29.917489513332 e8b1679c-0476-70d4-9fcd-2549ba3ee9d4
    01/06/2014 13:05:06.17  w3wp.exe (0x1698)                        0x1960 SharePoint Foundation        
     Monitoring                     nasq Medium   Entering monitored scope (Request (GET:<SiteURL>nsurance%20Benefits%2fLife%20Insurance%2fBasic%20Life%20and%20ADD&FolderCTID=0x01200039DA632EEACF264685CF39D68A18F7C8)).
    Parent No 
    Any clue?
    Regards,
    Khushi
    Khushi

  • I downloaded the latest version and I get this error when I open it. Problem signature:   Problem Event Name:     InPageError   Error Status Code:     c0000185   Faulting Media Type:     00000003   OS Version:     6.1.7601.2.1.0.768.3. Any clue why or how

    I downloaded the latest version and I get this error when I open it. Problem signature:   Problem Event Name:
    InPageError   Error Status Code:
    c0000185   Faulting Media Type:
    00000003   OS Version:
    6.1.7601.2.1.0.768.3. Any clue why or how to fix?

    InPageError
    That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
    XP instructions in the following document: How to perform disk error checking in Windows XP
    Vista instructions in the following document: Check your hard disk for errors
    Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
    Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
    Does the chkdsk find/repair any damage? If so, can you get itunes to launch properly afterwards?

  • The SharePoint item being crawled returned an error when attempting to download the item.

    I get this error when I run full crawl.
    The SharePoint item being crawled returned an error when attempting to download the item.
    I did make sure that the crawl account has full read access to the web application. I am able to access the page and site just fine from a browser. I am not sure what is causing the problem.

    On closely looking at ULS logs, this is what I am noticing....
    CSTS3Accessor::Init: SharePointError found in URL
    http://xxxxx/default.aspx header value 0, hr=8004FD0F  [sts3acc.cxx:566]  d:\office\source\search\native\gather\protocols\sts3\sts3acc.cxx 
    CSTS3Accessor::Init fails, Url sts4://xxxx/siteurl=/siteid={c011d5c9-9019-41e8-bf5a-5176739b2b79}/weburl=xxxxx/webid={e42001c0-2ef1-4a8e-8fe5-361d72fa60c2}, hr=8004FD0F  [sts3handler.cxx:312]  d:\office\source\search\native\gather\protocols\sts3\sts3handler.cxx 
    CSTS3Handler::CreateAccessorExD: Return error to caller, hr=8004FD0F            [sts3handler.cxx:330]  d:\office\source\search\native\gather\protocols\sts3\sts3handler.cxx 

  • LR 5.5 upgrade. I only get the the 32 bit set up and an error when the 64 bit set up should be created. It says not enough disk space and no access to write. The disk space is ok and the 32 bit file was indeed created.

    LR 5.5 upgrade. I only get the the 32 bit set up and an error when the 64 bit set up should be created. It says not enough disk space and no access to write. The disk space is okay and the 32 bit file was indeed created. I have Windows 7 Home edition.

    Hi Rob, Thanks for your input. The temp location is on the C drive with 228 GB free space. My other drives have 123 GB and 204 GB of free space. I can see how the 32 bit set up is perfectly extracted when it stops when coming to the 64 bit set up. I have done the exercise several times and also made new downloads. I am using Norton 360 and Malwarebytes anti-malware but the dowload from Adobe should be trusted.

  • Error while executing BEX query via FM

    Hi Friends,
    I am getting following error while executing a query via FM RRW3_GET_QUERY_VIEW_DATA.
    Please see the error screenshot as follows.
    the I_T_PARAMETERS entered are as follows.
    Please let me know what is missing.
    Thanks.
    Regards,
    Hrishikesh

    the key date variable 0DAT is normally filled by a SAP exit variable, but this may not be the case.  it could have been changed in the query designer,  check the query in query designer and see.
    Try passing 0DAT in the variable list with todays date

  • Error when executing query without passing variable selection

    Hi Gurus
    I am getting an error while executing a query with out passing values for variables
    When executing the query by passing the filter values report returns the data
    When executing the query with out passing variable selections the error message is
    Unknown error in SQL interface
    Error reading the data of Info Provider ZCRM_O08
    Error while reading data; navigation possible
    System error in program SSAPLRS_EXCEPTION and form
    RS_EXCEPTION_TO_MESSAGE
    No Data Available
    can any one please help me in resolving this
    Thank you

    Hi Srini
    Thanks for your quick response
    When i am executing the query with selection it is returning the data
    giving error when executing with out passing the selection
    is there any other cause for this problem
    like any particular info object causes this sort of problem
    Thank you

  • Webi report throwing error when executed

    HI Experts,
    While executing a Webi Report we are gettign following error when executing with more than one characteristics -
    A Database error occured. The database eror text is : The MDX Query select { [Measures].[4225B1TBMEMOYKZGDKLVINMAW] } ON COLUMNS FROM [ZMEPSC01/ZMEPSC01_QRY_0001]
    failed to execute with the error Unknown error.(WIS 10901).
    We tried changing the Universe -> Parameter -> Control -> Limit size of result set to -> unchecked it.
    But still the error remains. Can u put some light over it.
    Thanks.

    Hello ,
    Just Check with the BI the people they might change the the column name or some thing else in the bex Query that s way It is showing error.
    Refresh the universe and generate the report then check it.
    Thanks
    Santhosh V

  • Error when executing a .irpt page

    Hi,
    I am getting the below error when executing a .irpt from the workbench. I am on MII 12.2.2 Build (235).
    404   Not Found
    SAP NetWeaver Application Server 7.20 / AS Java 7.30
    Error: S:usrsapALXJ10j2eeclusterappssap.comxappsxmiiearservlet_jspXMII
    oot/XMII/CM/<Project>/<File.irpt>
    Troubleshooting Guide https://sdn.sap.com/irj/sdn/wiki?path=/display/jstsg/home
    Details: No details available.
    Please share your thoughts on this.
    Regards,
    Chanti.

    Hi Chanti,
    This sounds obvious, but check to make sure your irpt page has the extension .irpt in the workbench.  Depending on how you saved it, it might have been dropped.
    Also make sure the page is published by either saving it to web:// (not db://) or by right clicking and selecting Publish.
    Regards,
    Mike

  • Error when executing statement for table/stored proc

    Hi All,
          I am getting this error when executing IDOC to JDBC (Stored Procedure) Scenario.
         In my stored procedure I have three insert statements to insert rows in to 3 tables.
        This stored procedure is working fine for two insert statements i.e, 
             For this I have created data type for stored procedure with 10 elements and executed the scenario and was successfully running.
        when I added 3rd insert statement to stored procedure ie., when i added 5 more elements to the datatype (totally 15 elements) it starts giving the bellow error in Message Monitoring.
    <i><b>Exception caught by adapter framework: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
    <i><b>Delivery of the message to the application using connection JDBC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'COGRP_TMP_PROC_1' (structure 'Statements'): java.sql.SQLException: General error</b></i>
       Note:- I have run the stored procedure  with three insert statements in Sql Server, and also by calling an external program also, and was working fine.
    <i><b> Note : Is there any structure needs to be follow when working with IDOC to Stored procedure.</b></i>
    I am struck up with the error, can any body resolve this issue.
    Thanks in Advance,
    Murthy

    Hi narasimha,
                      This seems to be any error due to incorrect query formation.In your receiver jdbc channel set the parameter logSQLstatement = true.you can find this parameter in the advanced mode. Using this parameter you will be able to see the sql query which is generated at runtime in the audit log in RWB.
    Regards,
    Pragati

  • Runtime error when executing ME2B/ME3B if condition recs 160

    Dear all,
    I have created a vendor rebate agreement and entered condition records for a vendor/material combination.
    Since for this vendor there are 170 materials for which he provides rebate I have created 170 condition records.
    When I am trying to change or display the rebate agreement by executing transaction codes ME2B and ME3B respectively the following run time error occurs (Runtime error when executing transaction codes ME2B/ME3B for condition recrds >160):
    Runtime Errors: DBIF_RSQL_INVALID_RSQL
    Except. CX_SY_OPEN_SQL_DB
    The error is in function module SELECT_TEXT at line 120 "select * from stxh client specified into table stxh_buffer".
    When I debug or test/execute the function module SELECT_TEXT, I find that there are no relevant entries in table STXH for the vendor rebate agreements.
    Please note that if the condition records of the rebate agreement are 160 and less then there is no problem.
    I would appreciate if I could have your expert oppinion on what is causing this runtime error and if it is possible on how to resolve it.
    Thanks in advance.
    Regards,
    Mimis
    Edited by: Mimis1973 on Jan 26, 2011 11:18 AM
    Edited by: Mimis1973 on Jan 26, 2011 11:20 AM
    Edited by: Mimis1973 on Jan 26, 2011 11:23 AM

    There's something similar in OSS note 1002788. Is it relevant to your system?

Maybe you are looking for

  • Installed Photoshop CS5 on Windows 8 and it will not open. Help

    Installed photoshop CS5 on my new Windows 8 computer. Says its not compatible and will not open. Help

  • Unsupported Data Type (migration from Access 2000)

    Hi, I'm trying to convert an MS Access 2000 database, which contains a table with 2 'Binary' data type columns. The OMWB does not seem to know this Data Type, and the GUI does not allow me to add it. Is there any other way to add this Data Type ?? I

  • Debugging not working in weblogic portal

    When I am running my portal app built on weblogic portal 8.1, its throwing an error cannot start debugger. App might not be deployed properly. I have redeployed 2-3 times, and its running also fine, but debugger is not working. when the app domain st

  • Regarding Exception Messages in MD04

    Hi Gurus, Can any body explain what's the main scenario where we get 'Exception message 30' i.e. Plan the process according to Schedule? Is there any standard report which will display all the firmed planned/prod.ord based on MRP controller? Helpful

  • Blocking Calls from specified ANI number

    Hi all, I want to block  some calls for some ANI numbers.   Our CUBE has several SIP connections to different devices   Calls come from Telco SPCUBE to our cube and then it goes to either  CVP or CUCM Here are dial peers and translation rules I creat