views:

214

answers:

1

I created and deployed a package to SQL Server 2005. The package basically downloads a file (.csv) via FTP and extracts the contents to a table. The data is cleaned and then the data is moved to a production table.

After deploying the package, I tried calling it from a simple .NET application

      Dim app As New Application
    Dim pkg As Package

    Try
        pkg = app.LoadFromSqlServer("OrderImport", "machine\dataware", "sa", "sapassword", Nothing)

        Dim result As DTSExecResult = pkg.Execute()
        MsgBox(result.ToString)
    Catch ex As Exception
        MsgBox(ex.Message)
    Finally
        app = Nothing
        pkg = Nothing
    End Try

and got the message "Failure". I then went to SSIS via the Management Studio and tried to execute the package from there. It's able to download the files via FTP, however, when it reaches the .CSV file at the point to extract teh data it show an error

The system cannot find the file specified
ERROR: Cannot open the datafile filename.csv

What else can I look at? I want to be able to execute the package with SQL Server user accounts, if possible.

At the package level I have

ProtectionLevel = EncryptSensitiveWithUserKey
PackagePassword = [BLANK]

One more thing - how do I log these errors to a file?

+1  A: 

When you ftp the file is it actually copying it where you expect, with the correct name? You may want to put in the absolute path to the file.

I tend to get the SSIS package working from the command line before I try to run it from an application, easier to debug that way.

James Black
what commands do you use to run from command line? In the "For Each Loop Editor" I have "Name and Extension" selected.
Saif Khan
+1 for "I tend to get the SSIS package working from the command line before I try to run it from an application, easier to debug that way." I've seen way too many people dive into integration with an application before it even works at cmd!
Jefe
Because I develop on 64-bit Vista, but the excel source needs 32-bit I use this:C:\Windows\system32>"c:\Program Files (X86)\Microsoft SQL Server\100\dts\Binn\dtexec.exe" /f "C:\Users\owner\Documents\FormulaItems.dtsx" /X86
James Black