javamans
作者javamans·2010-05-31 19:32
it技术咨询顾问·Accenture

【原创】在SSIS包中使用FTP任务时,用户名及密码配置方法

字数 1115阅读 3124评论 0赞 1
    最近有一个需求,需要实现SSIS调用FTP,将EXCEL格式的文件上传到FTP。在测试时发现,在FTP任务中保存好的用户名和密码在重新执行时会丢失。
    错误信息如下:
    末次失败原因为:send XLS 出现错误!原因:无法使用“ftp connection”连接到 FTP 服务器。
在网上资料后发现有两种解决方法:
1) - edit the Expression Connection String of the FTP Connection Manager as @[User::FTP]+":21."+ @[User::User_NM_FTP]+"."+ @[User:Password_FTP]
- set the Protection Level of the package to EncryptSensitiveWithPassword (this is mandatory, the connection string setting is not enough)

2) create a Script Task where you set the property ServerPassword of the FTP Connection Manager. (you can also set more properties but the same work could be done directly in the Expressions of the FTP Connection Manager component)
 
最开始打算使用一个变量“ftp_conn”  ,设置为@[用户::192.168.0.1]+":21."+ @[用户::username]+"."+ @[用户:userpassword],设置ftp connection的"Expressions"中的属性表达式引用该变量,但一直报错,调试不成功。
 
后来调整思路,分别设置三个变量 : FTPIP ,FTP_USERNAME,FTP_PWD
并在设置ftp connection的"Expressions"中的属性表达式
@[用户::FTPIP]+":21"+ "."+@[用户::FTP_USERNAME]+"."+ @[用户::FTP_PWD]
保存后,重新执行,问题解决。
第二种方法也试验了一下,不过没有成功。
 

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

1

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关问题

相关资料

X社区推广