![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Can anyone tell me why the following gives me problems. '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() dim objFSO, strFullNm Set objFSO = CreateObject("Scripting.FileSystemObject") strFullNm = "d:\automate\filename.txt" If objFSO.FileExists(strFullNm) then msgbox "The File exists" Set objFSO = nothing Main = DTSTaskExecResult_Success Else Msgbox "No File" Set objFSO = nothing Main = DTSTaskExecResult_Failure ------------- THIS LINE ERRORS, but if I say DTSTaskExecResult_Success it goes through. End if End Function |
#3
| |||
| |||
|
|
Can anyone tell me why the following gives me problems. '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() dim objFSO, strFullNm Set objFSO = CreateObject("Scripting.FileSystemObject") strFullNm = "d:\automate\filename.txt" If objFSO.FileExists(strFullNm) then msgbox "The File exists" Set objFSO = nothing Main = DTSTaskExecResult_Success Else Msgbox "No File" Set objFSO = nothing Main = DTSTaskExecResult_Failure ------------- THIS LINE ERRORS, but if I say DTSTaskExecResult_Success it goes through. End if End Function |
#4
| |||
| |||
|
|
I get an error that says "task reported failure on execution" every time I try to follow the path of failure as described below. "Bill" <WBeatty (AT) Prodigy (DOT) Net> wrote in message news:uPUW3D0jDHA.2772 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Can anyone tell me why the following gives me problems. '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() dim objFSO, strFullNm Set objFSO = CreateObject("Scripting.FileSystemObject") strFullNm = "d:\automate\filename.txt" If objFSO.FileExists(strFullNm) then msgbox "The File exists" Set objFSO = nothing Main = DTSTaskExecResult_Success Else Msgbox "No File" Set objFSO = nothing Main = DTSTaskExecResult_Failure ------------- THIS LINE ERRORS, but if I say DTSTaskExecResult_Success it goes through. End if End Function |
#5
| |||
| |||
|
|
Yes that's because you told it to fail the task if the file was not found ! -- -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Bill" <WBeatty (AT) Prodigy (DOT) Net> wrote in message news:utrW1Y0jDHA.2200 (AT) TK2MSFTNGP12 (DOT) phx.gbl... I get an error that says "task reported failure on execution" every time I try to follow the path of failure as described below. "Bill" <WBeatty (AT) Prodigy (DOT) Net> wrote in message news:uPUW3D0jDHA.2772 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Can anyone tell me why the following gives me problems. '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() dim objFSO, strFullNm Set objFSO = CreateObject("Scripting.FileSystemObject") strFullNm = "d:\automate\filename.txt" If objFSO.FileExists(strFullNm) then msgbox "The File exists" Set objFSO = nothing Main = DTSTaskExecResult_Success Else Msgbox "No File" Set objFSO = nothing Main = DTSTaskExecResult_Failure ------------- THIS LINE ERRORS, but if I say DTSTaskExecResult_Success it goes through. End if End Function |
#6
| |||
| |||
|
|
I'm a little confused how to control the flow to the next task if the file is not found. If the file is found I perform a DDQ, if not I want to end the package with success. "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:#7rKRg0jDHA.1960 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Yes that's because you told it to fail the task if the file was not found ! -- -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Bill" <WBeatty (AT) Prodigy (DOT) Net> wrote in message news:utrW1Y0jDHA.2200 (AT) TK2MSFTNGP12 (DOT) phx.gbl... I get an error that says "task reported failure on execution" every time I try to follow the path of failure as described below. "Bill" <WBeatty (AT) Prodigy (DOT) Net> wrote in message news:uPUW3D0jDHA.2772 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Can anyone tell me why the following gives me problems. '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** Function Main() dim objFSO, strFullNm Set objFSO = CreateObject("Scripting.FileSystemObject") strFullNm = "d:\automate\filename.txt" If objFSO.FileExists(strFullNm) then msgbox "The File exists" Set objFSO = nothing Main = DTSTaskExecResult_Success Else Msgbox "No File" Set objFSO = nothing Main = DTSTaskExecResult_Failure ------------- THIS LINE ERRORS, but if I say DTSTaskExecResult_Success it goes through. End if End Function |
![]() |
| Thread Tools | |
| Display Modes | |
| |