Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


DTS Script Task: Runtime Error (VB Script Task)

I am getting the following error message:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

code relating to error (Putfiles):
Dim sesOpts As WinSCP.SessionOptions
Dim mySes As WinSCP.Session
Dim tranOpts As WinSCP.TransferOptions
Dim tranRes As WinSCP.TransferOperationResult

With sesOpts
.Protocol = WinSCP.Protocol.Sftp
.HostName = "<Client Specific>"
.port = <<Client Specific>>
.UserName = "<Client Specific>"
.Password = "<Client Specific>"
.SshHostKeyFingerprint = "<Client Specific>"
End With

tranOpts.TransferMode = WinSCP.TransferMode.Binary
tranRes = mySes.PutFiles(strDrive & strDir & Replace(strZipFile, "zip\", ""), "/" & Replace(strDir, "\", "/"), True, tranOpts)

I have referenced the winscp in the projects reference section (SCreenprint was attached)

at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()