Perjey
asked on
DTSStepScriptResult_DontExecuteTask return status issue
Hi,
I'm processing a number of files from a folder.If the first file has a size 0, I want to stop the task but wish to process the other files. I'm using the following code in the Workflow properties.
-------------------------- ---------- ---------- ---------- -
Function Main()
Dim oFSO, sFileName1,oFile
' Get filename from the Connections
sFilename1 = DTSGlobalVariables.Parent. Connection s("InputFi le").DataS ource
Set oFSO = CreateObject("Scripting.Fi leSystemOb ject")
Set oFile = oFSO.GetFile(sFilename1)
If oFile.Size > 0 Then
Main = DTSStepScriptResult_Execut eTask
Else
Main = DTSStepScriptResult_DontEx ecuteTask
End If
Set oFile = Nothing
Set oFSO = Nothing
End Function
-------------------------- ---------- ---------- ----------
It detects the first file size is 0 and therefore does
not run the task which is fine but 'DTSStepScriptResult_DontE xecuteTask ' seems to be returning a 'failure' status and therefore the rest of the files from the folder are not being picked up.
Is there any workaround or a way to force DTSStepScriptResult_DontEx ecuteTask to return a 'success' status which will enable the other files to be processed?
Thanks.
I'm processing a number of files from a folder.If the first file has a size 0, I want to stop the task but wish to process the other files. I'm using the following code in the Workflow properties.
--------------------------
Function Main()
Dim oFSO, sFileName1,oFile
' Get filename from the Connections
sFilename1 = DTSGlobalVariables.Parent.
Set oFSO = CreateObject("Scripting.Fi
Set oFile = oFSO.GetFile(sFilename1)
If oFile.Size > 0 Then
Main = DTSStepScriptResult_Execut
Else
Main = DTSStepScriptResult_DontEx
End If
Set oFile = Nothing
Set oFSO = Nothing
End Function
--------------------------
It detects the first file size is 0 and therefore does
not run the task which is fine but 'DTSStepScriptResult_DontE
Is there any workaround or a way to force DTSStepScriptResult_DontEx
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
have it delete all of the 0 length files from then directory.
then run your processing package.