Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTSStepScriptResult_DontExecuteTask failure status issue..

Status
Not open for further replies.

ton12

Programmer
Mar 9, 2005
58
GB
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.Connections("InputFile").DataSource

Set oFSO = CreateObject("Scripting.FileSystemObject")

Set oFile = oFSO.GetFile(sFilename1)

If oFile.Size > 0 Then

Main = DTSStepScriptResult_ExecuteTask
Else
Main = DTSStepScriptResult_DontExecuteTask
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_DontExecuteTask' 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_DontExecuteTask to return a 'success' status which will enable the other files to be processed?

Thanks.
Ton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top