woodmili.blogg.se

Ndm file transfer
Ndm file transfer













ndm file transfer

Tmp = "Select count(*) from " & vbCRLF & _

ndm file transfer

The query to search for today’s file name in RequestFiles is built with: We’ll know today’s file transferred successfully if it is listed in.

#Ndm file transfer code

The last block of code in the ActiveX Script sets values used in the steps that verify transfer. OFile.writeline "cd incoming" & vbCRLF & "ls -l " & vbCRLF & "quit" Set oFile = oFSO.OpenTextFile( DTSGlobalVariables ("TransferFTPVerifyReq").Value, 2, 1) ' Generate an FTP command file to verify that transfer worked. This FTP session is managed by another control file created in the ActiveX Script task. I obtain the directory listing through another FTP session. Using the stock ftp.exe, the most reliable method is to visit the remote system and get a list of files there. We needed to know if transfer was successful. The FTP client does not provide convenient diagnostics. OFile.writeline "mput " & DTSGlobalVariables("TransferFilename").Value

ndm file transfer

OFile.writeline DTSGlobalVariables("TransferFTPPassword") OFile.writeline DTSGlobalVariables("TransferFTPLogin") OFile.writeline ("open " & DTSGlobalVariables("TransferFTPServer")) Set oFile = oFSO.OpenTextFile( DTSGlobalVariables ("TransferFTPCommands").Value, 2, 1) Set oFSO = CreateObject("Scripting.FileSystemObject") Since the filename changes daily, you have to write a new control file. This can be done from the command line using a control file. The FTP process has to be told what file to send. & "\" & DTSGlobalVariables("TransferFileNameRoot") & You can set a package global variable in an ActiveX script this way (line 15 ):ĭTSGlobalVariables("TransferFilename") = DTSGlobalVariables("TransferFileDir") But because some Global Variables are constructed by string concatenations using other variables and constants, it was easier to assign them inside an ActiveX Script Task. Assignments like this can be done in a Dynamic Properties Task using a SQL query. The name of the output file is initialized to “Orders.”+today’s date. The package first sets up some controlling variables and files in the ActiveX Script task “ Setup for Today”.















Ndm file transfer