dbTalk Databases Forums  

How ActiveX Script Task return customized error message?

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


Discuss How ActiveX Script Task return customized error message? in the microsoft.public.sqlserver.dts forum.



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

Default How ActiveX Script Task return customized error message? - 04-05-2005 , 11:26 PM






Hello,

How can I return customized error string for the scheduler/manually excuting
to write to log/double click show error?

For example

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()

If something wrong
' Some statements here to "return" a customized error message.
Main = DTSTaskExecResult_Failure
exit Function
end if

Main = DTSTaskExecResult_Success
End Function




Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How ActiveX Script Task return customized error message? - 04-06-2005 , 12:33 AM






You can write to the log in an Active Script task

DTSPackageLog.WriteStringToLog "Nuts !!"

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Nick" <nbdy9 (AT) hotmail (DOT) removethis.com> wrote

Quote:
Hello,

How can I return customized error string for the scheduler/manually
excuting to write to log/double click show error?

For example

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()

If something wrong
' Some statements here to "return" a customized error message.
Main = DTSTaskExecResult_Failure
exit Function
end if

Main = DTSTaskExecResult_Success
End Function






Reply With Quote
  #3  
Old   
Darren Green
 
Posts: n/a

Default Re: How ActiveX Script Task return customized error message? - 04-06-2005 , 04:10 AM



I also find Err.Raise can be quite effective.


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
You can write to the log in an Active Script task

DTSPackageLog.WriteStringToLog "Nuts !!"

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Nick" <nbdy9 (AT) hotmail (DOT) removethis.com> wrote in message
news:OkM%23WDmOFHA.3560 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Hello,

How can I return customized error string for the scheduler/manually
excuting to write to log/double click show error?

For example

'************************************************* *********************
' Visual Basic ActiveX Script

'************************************************* ***********************

Function Main()

If something wrong
' Some statements here to "return" a customized error message.
Main = DTSTaskExecResult_Failure
exit Function
end if

Main = DTSTaskExecResult_Success
End Function








Reply With Quote
  #4  
Old   
nick
 
Posts: n/a

Default Re: How ActiveX Script Task return customized error message? - 04-06-2005 , 09:39 AM





"Allan Mitchell" wrote:

Quote:
You can write to the log in an Active Script task

DTSPackageLog.WriteStringToLog "Nuts !!"

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Nick" <nbdy9 (AT) hotmail (DOT) removethis.com> wrote in message
news:OkM%23WDmOFHA.3560 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Hello,

How can I return customized error string for the scheduler/manually
excuting to write to log/double click show error?

For example

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()

If something wrong
' Some statements here to "return" a customized error message.
Main = DTSTaskExecResult_Failure
exit Function
end if

Main = DTSTaskExecResult_Success
End Function







Reply With Quote
  #5  
Old   
nick
 
Posts: n/a

Default Re: How ActiveX Script Task return customized error message? - 04-06-2005 , 10:19 AM



Thanks.
Where to find the log? I cannot find the "Nuts !!" message in Windows Event
Log, SQL log or the log file specified for the Job step....


"Allan Mitchell" wrote:

Quote:
You can write to the log in an Active Script task

DTSPackageLog.WriteStringToLog "Nuts !!"

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Nick" <nbdy9 (AT) hotmail (DOT) removethis.com> wrote in message
news:OkM%23WDmOFHA.3560 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Hello,

How can I return customized error string for the scheduler/manually
excuting to write to log/double click show error?

For example

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()

If something wrong
' Some statements here to "return" a customized error message.
Main = DTSTaskExecResult_Failure
exit Function
end if

Main = DTSTaskExecResult_Success
End Function







Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: How ActiveX Script Task return customized error message? - 04-06-2005 , 01:59 PM



Enable package logging.

Right Click on the design surface | Package Properties | Logging

--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - SQL Server 2005 Integration Services.
www.Konesans.com


"nick" <nick (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thanks.
Where to find the log? I cannot find the "Nuts !!" message in Windows Event
Log, SQL log or the log file specified for the Job step....


"Allan Mitchell" wrote:

You can write to the log in an Active Script task

DTSPackageLog.WriteStringToLog "Nuts !!"

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Nick" <nbdy9 (AT) hotmail (DOT) removethis.com> wrote in message
news:OkM%23WDmOFHA.3560 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Hello,

How can I return customized error string for the scheduler/manually
excuting to write to log/double click show error?

For example

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()

If something wrong
' Some statements here to "return" a customized error message.
Main = DTSTaskExecResult_Failure
exit Function
end if

Main = DTSTaskExecResult_Success
End Function









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.