Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSIS Pckg FTP Task FTP Connection Manager will not store or save password 1

Status
Not open for further replies.

awaria

IS-IT--Management
Sep 16, 2010
100
US
Using Visual Studio 2008 with MSSQL Server 2008 Sp2 on Windows Server 2008 R2

Building a pckg to FTP files to remote server, however, it fails because the connection manager will not save the password.
I cab successfully test, but once connection manager closed, pckg saved and closed, the FTP user password is not stored so
connection keeps failing.

Any assistance in resolving is appreciated.

Thanks,
Andrew
 
Put password in variable and use expressions to configure connection with password from variable
 
Thanks for reply. Not to sure where to apply the expression. I have the FTP Task withih a For each loop container.
I tried to add a script task and put the password in a variable there, but nor sure I did it correctly, it didn't work.
I placed the script task within the container as well. Not sure how to relate FTP task and Script task.

I am non-technical and new to SSIS, could benefit from more details if you;re willing to provide.

Thanks for sharing your input.

Andrew

 
gk53,

Got it working. Had to execute script task prior to FTP Task and had misspaelled connection name.

Thanks for helping.

Andrew
 
Hi Andrew, could you show where you put the code?
Thanks,
Michael
 
Michael,

Env = (VStudio 2008) (MSSQL 2008 R2).
In the for loop container I have a script task, then ftp task then a sendmail task (optional).
An FTPconnectionmanager and a sendmailconenctionmanager

In the script task I have the following code;
--

using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;

namespace ST_0e9e309f48b74816bfd49ead85ff2639.csproj
{
[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
{

#region VSTA generated code
enum ScriptResults
{
Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
};
#endregion

Hope this helps,
Andrew

public void Main()
{
ConnectionManager FTPConn;
FTPConn = Dts.Connections["FTP Connection Manager"];
FTPConn.Properties["ServerPassword"].SetValue(FTPConn, Dts.Variables["FTPPassword"].Value);

Dts.TaskResult = (int)ScriptResults.Success;
}
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top