Attention, Looking for DTS input using the FSO Obj

Results 1 to 2 of 2

Thread: Attention, Looking for DTS input using the FSO Obj

  1. #1
    Join Date
    Dec 1969

    Default Attention, Looking for DTS input using the FSO Obj

    I’m in the process of creating some general error checking before running a DTS package. Here are the choices to be made prior to running the package.<BR><BR>If the source file exists in my source directory then I want to<BR>run the package: Main = DTSTaskExecResult_Success<BR><BR>If the source file exists in my destination directory then I want to roll back the package and rerun it: DTSTaskExecResult_Success<BR><BR>And last if the source file does not exist in either the source directory or the Destination directory then the package will not run at all: DTSTaskExecResult_Failed<BR><BR>The problem that I am having is specifying in the first two scenarios: DTSTaskExecResult_Success <BR><BR>Which one to run according to the results of my code listed below?<BR><BR>In both cases my workflow is labeled “Success” thus both would run. <BR><BR>Here is the code that I have currently in ActiveX using FSO <BR><BR>Set objFSO = CreateObject("Scripting.FileSystemObject")<BR><BR> If objFSO.FileExists(strDTSSourceDir) Then<BR> <BR> Results = "File Does Exists! Package has started."<BR> MsgBox (Results)<BR> <BR> Main = DTSTaskExecResult_Success<BR><BR><BR> Else if objFSO.FileExists(strDTSDestinationDir) Then<BR><BR> Results = "This package has already run for the current month. Package is now rolling back."<BR> MsgBox (Results)<BR> <BR> Main = DTSTaskExecResult_Success<BR><BR> Else<BR> <BR> Results = "The File VIAMRS DOES NOT EXIST IN either the Source/Destination Directories, thus DTS package will not run."<BR> MsgBox (Results)<BR> <BR> Main = DTSTaskExecResult_Failed<BR> <BR><BR> End If<BR> End If<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default exuse the simplictity

    if exists(source) then<BR> if exists(destination) then<BR> result = "in both"<BR> else<BR> result = "in source only"<BR> end if<BR>else<BR> if exists(destination) then<BR> result = "in destination only"<BR> else<BR> result = "in neither"<BR> end if<BR>end if<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts