FTP连接字符串使用SSIS中的表达式 [英] FTP Connection string using expression in SSIS
问题描述
在我的SSIS 2005软件包中,我需要通过表达式给出FTP Connectionstring,因为我需要使用dtsConfig文件为用户配置它。
In my SSIS 2005 package, I need to give the FTP Connectionstring via an expression as I need to keep it configurable for the user from the dtsConfig file.
当时我尝试给出以下表达式:
At the moment I tried giving the following expression:
Connectionstring = @ [User :: FTPServer] +。 + @ [User :: FTPUser] +。 + @ [User :: FTPPass]
Connectionstring = @[User::FTPServer] + "." + @[User::FTPUser] + "." + @[User::FTPPass]
对于这种独特的语法,我从 http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/ 3713e9a5-343a-4c5b-ac5d-1508cd5ab8be
For this unique syntax, I took pointers from the discussion at http://social.msdn.microsoft.com/Forums/en-US/sqlintegrationservices/thread/3713e9a5-343a-4c5b-ac5d-1508cd5ab8be
我的FTPServer变量还具有MYSERVERNAME格式的端口信息:21。
My FTPServer variable also has port info in the format MYSERVERNAME:21.
但是我收到错误530 User anonymous unknown
But I am getting the error "530 User anonymous unknown"
任何想法如何解决这个错误?
Any idea how I can fix this error?
推荐答案
我认为你的变量应该有两个 ::
不是一个。
I think your variables should have two ::
not one.
@ [User :: FTPServer] +。 + @ [User :: FTPUser] +。 + @ [User :: FTPPass]
编辑
由于密码被清除
我将通过脚本任务事先设置这些细节。运行脚本,然后运行FTP任务 - 我认为应该这样工作。
What I would do is set these details beforehand via a Script Task. Run the script and then run the FTP Task - I think that should that work.
Public Class ScriptMain
Public Sub Main()
Dim FTPConnectionManager As ConnectionManager
'Set variable to an existing connection manager
' Replace "FTP Server" with the name of your existing FTP Connection Manager
FTPConnectionManager = Dts.Connections("FTP Server")
FTPConnectionManager.Properties("ServerName").SetValue(FTPConnectionManager, Dts.Variables("FTPServer").Value)
FTPConnectionManager.Properties("ServerPort").SetValue(FTPConnectionManager, Dts.Variables("FTPPort").Value)
FTPConnectionManager.Properties("ServerUserName").SetValue(FTPConnectionManager, Dts.Variables("FTPUserName").Value)
FTPConnectionManager.Properties("ServerPassword").SetValue(FTPConnectionManager, Dts.Variables("FTPPassword").Value)
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
这篇关于FTP连接字符串使用SSIS中的表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!