Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6899129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:22:58+00:00 2026-05-27T07:22:58+00:00

Using the script task below to stuff list of files into User::ftp_file_list. But, the

  • 0

Using the script task below to stuff list of files into User::ftp_file_list. But, the For Each Loop container in the next step returns the error “Foreach Loop Container: The object in the variable “User::ftp_file_list” does not contain an enumerator.”

OK, turns out that the issue is that the connection is not being made. The thing I don’t understand is that I’ve tested the connection independently without any trouble. So, I’m a bit perplexed why it’s not connecting in the script task.

Anyone have any thoughts? Thanks in advance!

Public Sub Main()
    Dim result As Integer
    Dim manager As ConnectionManager
    Dim ftpClient As FtpClientConnection
    Dim foldersList As String()
    Dim filesList As String()
    Dim var As Variables

    manager = Dts.Connections("FTP_Connection")

    ftpClient = New FtpClientConnection(manager.AcquireConnection(Nothing))

    Try
        If ftpClient.Connect() Then

            Call ftpClient.SetWorkingDirectory(Dts.Variables("ftp_path").ToString)
            Call ftpClient.GetListing(foldersList, filesList)


            ' Store files list in package variable.'
            Call Dts.VariableDispenser.LockOneForWrite("ftp_file_list", var)

            Try
                var("ftp_file_list").Value = filesList
            Finally
                Call var.Unlock()
            End Try

        End If

    Catch ex As Exception

        result = Dts.TaskResult = ScriptResults.Failure

        Call Dts.Events.FireError( _
            0, _
            String.Empty, _
            ex.Message, _
            String.Empty, _
            0)

    Finally

        Call ftpClient.Close()

    End Try

    Dts.TaskResult = ScriptResults.Success

End Sub ' Main
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:22:59+00:00Added an answer on May 27, 2026 at 7:22 am

    It turns out that this was a problem created by 64bit mode. After I changed Run64BitRuntime = False, everything worked properly!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Ant script that performs a copy operation using the 'copy' task
I'm using this script to display all the images in a folder, but I
I am using a bash script (below) on a remote server (so far using
Using Script Task, I have written a code to create a folder and create
Using Script Task, I had stored data ie a Dataset or Datatable object to
I am using a script task in ssis 2005 which takes some time and
I'm using the PHP script below for an experiment I am conducting, however it
Besides using script or an iframe, is there any way to get independently operating
I'm using script language ChaiScript with c++ and Qt. I've defined such function: void
I recorded a script using the Selenium IDE extension for Firefox, and I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.