dbTalk Databases Forums  

Stopping VBScript Loop on Cancel

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


Discuss Stopping VBScript Loop on Cancel in the microsoft.public.sqlserver.dts forum.



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

Default Stopping VBScript Loop on Cancel - 03-01-2005 , 11:35 AM






I have a DTS package that loops through a temp table of records and imports
a list of files based on these records.
I'm wondering if it's possible to check the state of the package from within
my ActiveX task that is doing the looping, to see if the user running the
package has it the cancel button?
I'd like to be able to stop the loop if the cancel button is clicked - the
project is still in DEV and that's why I'd like to be able to stop it if
necessary.
My original aproach was to use a ConfigSettings table I have, and add a
value in there that I can check during the loops to indicate if I should
exit the loop or not, but then thought maybe there would be a way to just
check the state of the package to see if the cancel button was pressed or
not.

Thoughts?



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

Default Re: Stopping VBScript Loop on Cancel - 03-01-2005 , 02:26 PM






There is no way I can think of doing this. Clicking cancel sets a stat which
is checked on the OnCancel event which tasks can implement. They detect that
cancel has been set and then bail out. Unfortunately the script task does
not raise OnCancel during the script execution, so no I think is the answer.
You could do this with code, use a MsgBox statement and click Yes or No to
continue, nasty but it would work.


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

"Simon Worth" <simon.worth (AT) gmail (DOT) com> wrote

Quote:
I have a DTS package that loops through a temp table of records and
imports
a list of files based on these records.
I'm wondering if it's possible to check the state of the package from
within
my ActiveX task that is doing the looping, to see if the user running the
package has it the cancel button?
I'd like to be able to stop the loop if the cancel button is clicked - the
project is still in DEV and that's why I'd like to be able to stop it if
necessary.
My original aproach was to use a ConfigSettings table I have, and add a
value in there that I can check during the loops to indicate if I should
exit the loop or not, but then thought maybe there would be a way to just
check the state of the package to see if the cancel button was pressed or
not.

Thoughts?





Reply With Quote
  #3  
Old   
Simon Worth
 
Posts: n/a

Default Re: Stopping VBScript Loop on Cancel - 03-01-2005 , 02:46 PM



Yeah, that's what I thought the case may be. I decided to just use the
config table instead, and it works.
Thanks for the response though.

Simon

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
There is no way I can think of doing this. Clicking cancel sets a stat
which
is checked on the OnCancel event which tasks can implement. They detect
that
cancel has been set and then bail out. Unfortunately the script task does
not raise OnCancel during the script execution, so no I think is the
answer.
You could do this with code, use a MsgBox statement and click Yes or No to
continue, nasty but it would work.


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

"Simon Worth" <simon.worth (AT) gmail (DOT) com> wrote in message
news:eNatjUoHFHA.1528 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
I have a DTS package that loops through a temp table of records and
imports
a list of files based on these records.
I'm wondering if it's possible to check the state of the package from
within
my ActiveX task that is doing the looping, to see if the user running
the
package has it the cancel button?
I'd like to be able to stop the loop if the cancel button is clicked -
the
project is still in DEV and that's why I'd like to be able to stop it if
necessary.
My original aproach was to use a ConfigSettings table I have, and add a
value in there that I can check during the loops to indicate if I should
exit the loop or not, but then thought maybe there would be a way to
just
check the state of the package to see if the cancel button was pressed
or
not.

Thoughts?







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.