DTS VB ActiveX Script + Executing Job Step'1 (abcd)' -
06-11-2004
, 06:04 AM
I have define it in to a package names "abcd". It will check the existed
of folder and file. If those of them does not existed, it will recreat.
This package I have set the schedule time to be run in every minute. I
got success in running this package manually but when I remove all the files
and folder that I have just created by running this package manually. I got
nothing and I have seen in Job, the column status "Executing Job Step'1
(abcd)' ". This message still appear without ending.
Could any one tell me how could I solve this problem?
The following code is the script that I have writen to create folder and
the file.
'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************
Function Main()
dim filename, commandfilename
dim foldername, folderreceive
filename = DTSGlobalVariables("TransferCommandFileName").valu e
foldername = DTSGlobalVariables("TransferFolder").value
commandfilename = foldername &"\"&filename
folderreceive = foldername &"\"&
DTSGlobalVariables("ReceiveFolder").value
set oFSO = CreateObject("Scripting.FileSystemObject")
If Not oFSO.FolderExists(foldername) Then
oFSO.CreateFolder(foldername)
End if
If Not oFSO.FolderExists(folderreceive) Then
oFSO.CreateFolder(folderreceive)
End if
If NOT oFSO.FileExists(commandfilename) Then
set oFile = oFSO.OpenTextFile(commandfilename , 2, 1)
oFile.writeline ("open " & DTSGlobalVariables("TransferServer"))
oFile.writeline DTSGlobalVariables("TransferLogin")
oFile.writeline DTSGlobalVariables("TransferPassword")
oFile.writeline "get " &
DTSGlobalVariables("TransferFileSourceName").Value &" "& folderreceive &"\"&
DTSGlobalVariables("TransferFileDestinationName"). Value
oFile.writeline "quit"
oFile.Close
set oFile = nothing
End If
set oFSO = nothing
Main = DTSTaskExecResult_Success
End Function |