DTS Package Error Handling

I am writing a vbscript active script to generate some files.  I would like to stop the creation of file when it encounters an error. Are there any examples of that anybody can share with me?  Right now what happens is that it creates the file (probably in the middle) and then stops the DTS package...  I would like to stop if from creating the file at all...  I may have to move the save file code to somewhere else...
RVattakunntelAsked:
Who is Participating?
 
AaronAbendConnect With a Mentor Commented:
wrong ... check this out

http://www.sqlservercentral.com/columnists/hji/usingvbscripttoautomatetasks.asp

(without access to dts any more it is hard to help.. but for that same reason, I know there are not many dts guys left out there so I am just trying to help as much as I can)
0
 
AaronAbendCommented:
I think you can set up a workflow "failure" step and go from that step on failure and take action as needed. Sorry I cannot even open my old dts packages since upgrading to 2005.
0
 
RVattakunntelAuthor Commented:
ok.  I have a sendmail task if the active x script fails but I want to fail the dTS package if certain error occurs.
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
AaronAbendCommented:
I suggest deleting the file in the process that fires when it fails... there should be a way to do that in activex. You may have to create a DOS command and RUN it or something like that.
0
 
Anthony PerkinsCommented:
If there is an error the file is not created.
0
 
RVattakunntelAuthor Commented:
That is not a bad idea to delete the file when an error occurs.  Any examples of vbscript in doing that?
0
 
AaronAbendCommented:

set oFile = oFSO.GetFile(sFilename)
oFile.Delete(True)

I think this does it
0
 
Anthony PerkinsConnect With a Mentor Commented:
Or simply:

Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.DeleteFile "YourFileNameGoesHere", True
Set FSO = Nothing
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.