![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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? |
#3
| |||
| |||
|
|
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? |
![]() |
| Thread Tools | |
| Display Modes | |
| |