dbTalk Databases Forums  

DTS ActiveX script Cancel

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


Discuss DTS ActiveX script Cancel in the microsoft.public.sqlserver.dts forum.



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

Default DTS ActiveX script Cancel - 08-13-2003 , 11:13 AM






I am running an ActiveX that pops up a msgbox for the entry that will
set a global variable for the rest of my DTS package. The problem I
am having is when I run this package and should I decide to click the
cancel button it still says that tasked failed. I am sure this is
because I set it to fail if there was no entry given. Im unsure how
to set this activeX script. If I cancel I dont want to receive and
error. I just want it to stop the DTS package.
Below is the code I used.

Option Explicit

Function Main()

Dim pkg
'Dim sGrpDesc
Dim sInput

'Set Package reference
set pkg = DTSGlobalVariables.Parent

Main = DTSTaskExecResult_Failure

'sGrpDesc = "Get Files"
sInput = InputBox("Type ProcDate as follows", "Get Files",
"7/7/2003")

if sInput <> "" then
DTSGlobalVariables("gv_ProcDate").Value = sInput

Main = DTSTaskExecResult_Success
end if

End Function


Please Help!

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

Default Re: DTS ActiveX script Cancel - 08-14-2003 , 01:15 AM






Not in the interface. Executing through VB yes (pbCancel)

If they press cancel the package should just exit left and gracefully.
Workflow is still your best bet. Personally I would not be interactive in
my packages. In then means I cannot reuse them in a job. I would pass
parameters to the package which you can change at will and grab up front.

--

----------------------------
Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org



"Matt L" <mattclarson (AT) hotmail (DOT) com> wrote

Quote:
Actually when anyone goes to execute the DTS package should they have
a second thought and want to cancel the package. They hit cancel
button to get out of package. I dont want it to popup an error. Is
there a property for the cancel button that can be referenced?


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

Hello, Matt!

You should be able to set both conditions of the IF to return a success.
You, I presume want the package to exit stage left if there is no value
in
there. For this you will need workflow.

Multiple Paths in Workflow
http://www.sqldts.com/default.aspx?6,103,218,7,1

--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

: Option Explicit

: Function Main()

: Dim pkg
: 'Dim sGrpDesc
: Dim sInput

: 'Set Package reference
: set pkg = DTSGlobalVariables.Parent

: Main = DTSTaskExecResult_Failure

: 'sGrpDesc = "Get Files"
: sInput = InputBox("Type ProcDate as follows", "Get Files",
: "7/7/2003")

: if sInput <> "" then
: DTSGlobalVariables("gv_ProcDate").Value = sInput

: Main = DTSTaskExecResult_Success
: end if

: 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.