dbTalk Databases Forums  

ActiveX Scripting in a JobStep

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss ActiveX Scripting in a JobStep in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Barr
 
Posts: n/a

Default ActiveX Scripting in a JobStep - 05-02-2006 , 12:04 PM






I am trying to figure out how to cause the JobStep to Error on a condition so
i can have it retry later. The JobStep is written in ActiveX, VBScript. The
JobStep basically does this:


Dim oFso, oFolder, bErr

Set bErr = 0

Set oFso = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFso.GetFolder("C:\Temp")

If oFolder.Files.Count < 10 Then
bErr = 1
End If


Set oFolder = Nothing
Set oFso = Nothing

If bErr = 1 Then
'Cause JobStep to Fail
End If




Reply With Quote
  #2  
Old   
Walter Mallon
 
Posts: n/a

Default Re: ActiveX Scripting in a JobStep - 05-02-2006 , 03:48 PM






Here you go:

If bErr = 1 Then
Main = DTSTaskExecResult_Failure
End If

Walter


Main = DTSTaskExecResult_Failure
"John Barr" <JohnBarr (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am trying to figure out how to cause the JobStep to Error on a condition
so
i can have it retry later. The JobStep is written in ActiveX, VBScript.
The
JobStep basically does this:


Dim oFso, oFolder, bErr

Set bErr = 0

Set oFso = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFso.GetFolder("C:\Temp")

If oFolder.Files.Count < 10 Then
bErr = 1
End If


Set oFolder = Nothing
Set oFso = Nothing

If bErr = 1 Then
'Cause JobStep to Fail
End If






Reply With Quote
  #3  
Old   
John Barr
 
Posts: n/a

Default Re: ActiveX Scripting in a JobStep - 05-02-2006 , 04:29 PM



This is not in a DTS Package, i know how to do that, this is straight from a
jobstep with a type of ActiveX Script.

"Walter Mallon" wrote:

Quote:
Here you go:

If bErr = 1 Then
Main = DTSTaskExecResult_Failure
End If

Walter


Main = DTSTaskExecResult_Failure
"John Barr" <JohnBarr (AT) discussions (DOT) microsoft.com> wrote in message
news7B25535-2D34-4757-8E3A-3E55A7E49357 (AT) microsoft (DOT) com...
I am trying to figure out how to cause the JobStep to Error on a condition
so
i can have it retry later. The JobStep is written in ActiveX, VBScript.
The
JobStep basically does this:


Dim oFso, oFolder, bErr

Set bErr = 0

Set oFso = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFso.GetFolder("C:\Temp")

If oFolder.Files.Count < 10 Then
bErr = 1
End If


Set oFolder = Nothing
Set oFso = Nothing

If bErr = 1 Then
'Cause JobStep to Fail
End If







Reply With Quote
  #4  
Old   
Walter Mallon
 
Posts: n/a

Default Re: ActiveX Scripting in a JobStep - 05-02-2006 , 05:06 PM



My bad. Perhaps in the vbscript connect to the db and issue a Raiserror.

Walter

"John Barr" <JohnBarr (AT) discussions (DOT) microsoft.com> wrote

Quote:
This is not in a DTS Package, i know how to do that, this is straight from
a
jobstep with a type of ActiveX Script.

"Walter Mallon" wrote:

Here you go:

If bErr = 1 Then
Main = DTSTaskExecResult_Failure
End If

Walter


Main = DTSTaskExecResult_Failure
"John Barr" <JohnBarr (AT) discussions (DOT) microsoft.com> wrote in message
news7B25535-2D34-4757-8E3A-3E55A7E49357 (AT) microsoft (DOT) com...
I am trying to figure out how to cause the JobStep to Error on a
condition
so
i can have it retry later. The JobStep is written in ActiveX, VBScript.
The
JobStep basically does this:


Dim oFso, oFolder, bErr

Set bErr = 0

Set oFso = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFso.GetFolder("C:\Temp")

If oFolder.Files.Count < 10 Then
bErr = 1
End If


Set oFolder = Nothing
Set oFso = Nothing

If bErr = 1 Then
'Cause JobStep to Fail
End If









Reply With Quote
  #5  
Old   
Walter Mallon
 
Posts: n/a

Default Re: ActiveX Scripting in a JobStep - 05-02-2006 , 05:08 PM



Or perhaps try putting a syntax error in the error if then block and see if
that works.


"John Barr" <JohnBarr (AT) discussions (DOT) microsoft.com> wrote

Quote:
This is not in a DTS Package, i know how to do that, this is straight from
a
jobstep with a type of ActiveX Script.

"Walter Mallon" wrote:

Here you go:

If bErr = 1 Then
Main = DTSTaskExecResult_Failure
End If

Walter


Main = DTSTaskExecResult_Failure
"John Barr" <JohnBarr (AT) discussions (DOT) microsoft.com> wrote in message
news7B25535-2D34-4757-8E3A-3E55A7E49357 (AT) microsoft (DOT) com...
I am trying to figure out how to cause the JobStep to Error on a
condition
so
i can have it retry later. The JobStep is written in ActiveX, VBScript.
The
JobStep basically does this:


Dim oFso, oFolder, bErr

Set bErr = 0

Set oFso = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFso.GetFolder("C:\Temp")

If oFolder.Files.Count < 10 Then
bErr = 1
End If


Set oFolder = Nothing
Set oFso = Nothing

If bErr = 1 Then
'Cause JobStep to Fail
End If









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.