'********************************************************************** ' Visual Basic ActiveX Script '************************************************************************
Function GetImportDate(fld) GetImportDate=Mid(fld,5,2) & "/" & right(fld,2) & "/" & left(fld,4) End Function
Function Main() Dim pkg Dim fso Dim flo Dim fileDate DTSGlobalVariables("Directory").Value="//bert/vol1/RXVender/NewPrx/" set fso=createobject("Scripting.filesystemobject") set flo=fso.getfolder(DTSGlobalVariables("Directory").Value) set pkg=DTSGlobalVariables.parent set txtconn=pkg.connections("CrossReferrence_Backup")
Set fso = CreateObject("Scripting.FileSystemObject") txtconn.datasource= DTSGlobalVariables("Directory") & "CrossReferrenceAll_Mon_" & Replace( Date(),"/","") & ".csv" DTSGlobalVariables("fileName").Value= DTSGlobalVariables("Directory") & "CrossReferrenceAll_Mon_" & Replace( Date(),"/","") & ".csv" If DTSGlobalVariables("fileName").Value <> "" THEN pkg.Steps("DTSStep_DTSActiveScriptTask_1").ExecutionStatus = DTSStepExecStat_Waiting Main = DTSStepScriptResult_ExecuteTask ELSE pkg.Steps("DTSStep_DTSActiveScriptTask_1").ExecutionStatus = DTSStepExecStat_Completed Main = DTSTaskExecResult_Failure END IF set pkg = nothing End Function