dbTalk Databases Forums  

Can I chk if DTS package is executed interactively?

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


Discuss Can I chk if DTS package is executed interactively? in the microsoft.public.sqlserver.dts forum.



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

Default Can I chk if DTS package is executed interactively? - 08-04-2004 , 04:20 AM






DTS packages can be excuted "manually", or it can be run automatically (for
example as a scheduled job under SqlServerAgent).

Question: Can I easily, in an ActiveX script task (VbScript), test for what
"kind of" execution enviromment the package is executed under?

What I want is to prompt for som additional information when a
user-interface is available. If run automatically, such prompting will force
the execution to stop - waiting for an answer.

Thanks for your help.
Ronald



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

Default Re: Can I chk if DTS package is executed interactively? - 08-04-2004 , 07:17 AM






I really don't think this can be done. There is no hook back out to the
calling application for you to query the identity from. Obviously workaround
is to ask the questions in the calling app instead and pass in the answers
to the package.

DTS is a just like any other COM object. How can you determine the caller
from within a COM object? Maybe there is some strange stack API call
around.. ? This at the least would require a custom component which may
confuse it further by adding another layer.


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

"Ronald Kloverod" <ronald.kloverod (AT) xexcom (DOT) no> wrote

Quote:
DTS packages can be excuted "manually", or it can be run automatically
(for
example as a scheduled job under SqlServerAgent).

Question: Can I easily, in an ActiveX script task (VbScript), test for
what
"kind of" execution enviromment the package is executed under?

What I want is to prompt for som additional information when a
user-interface is available. If run automatically, such prompting will
force
the execution to stop - waiting for an answer.

Thanks for your help.
Ronald





Reply With Quote
  #3  
Old   
Ronald Kloverod
 
Posts: n/a

Default Re: Can I chk if DTS package is executed interactively? - 08-04-2004 , 08:22 AM



Thanks anyway, Darren.

I asked because I feel quite sure (if I remember correctly) that Excel can
tell me this. So a workaround is for sure to launch an Excel-component, and
ask.. Though, I cannot be sure that Excel is installed on the machine,
that's why I was searching for another way of doing this. If anyone could
know how Excel does this, I should be happy.... :-)

Ronald.

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

Quote:
I really don't think this can be done. There is no hook back out to the
calling application for you to query the identity from. Obviously
workaround
is to ask the questions in the calling app instead and pass in the answers
to the package.

DTS is a just like any other COM object. How can you determine the caller
from within a COM object? Maybe there is some strange stack API call
around.. ? This at the least would require a custom component which may
confuse it further by adding another layer.


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

"Ronald Kloverod" <ronald.kloverod (AT) xexcom (DOT) no> wrote in message
news:uv6eFRgeEHA.2804 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
DTS packages can be excuted "manually", or it can be run automatically
(for
example as a scheduled job under SqlServerAgent).

Question: Can I easily, in an ActiveX script task (VbScript), test for
what
"kind of" execution enviromment the package is executed under?

What I want is to prompt for som additional information when a
user-interface is available. If run automatically, such prompting will
force
the execution to stop - waiting for an answer.

Thanks for your help.
Ronald







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

Default Re: Can I chk if DTS package is executed interactively? - 08-06-2004 , 02:53 AM



Never heard of Excel being able to do this sort of thing, but you shoudl be
able to check if Excel is installed or not.

One method, and probably not the best woudl be to try and create the Execel
object and trap any errro hich indiacets it is not installed.

e.g.

On Error Resume Next

Dim oExcel
Set oExcel = CreateObject("Excel.Application")
If Err.Number = 0 Then
MsgBox "Excel has arrived!"
oExcel.Quit
Else
MsgBox "No Excel"
End If
Set oExcel = Nothing
On Error Goto 0


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

"Ronald Kloverod" <ronald.kloverod (AT) xexcom (DOT) no> wrote

Quote:
Thanks anyway, Darren.

I asked because I feel quite sure (if I remember correctly) that Excel
can
tell me this. So a workaround is for sure to launch an Excel-component,
and
ask.. Though, I cannot be sure that Excel is installed on the machine,
that's why I was searching for another way of doing this. If anyone could
know how Excel does this, I should be happy.... :-)

Ronald.

"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message
news:OKWsi0heEHA.724 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
I really don't think this can be done. There is no hook back out to the
calling application for you to query the identity from. Obviously
workaround
is to ask the questions in the calling app instead and pass in the
answers
to the package.

DTS is a just like any other COM object. How can you determine the
caller
from within a COM object? Maybe there is some strange stack API call
around.. ? This at the least would require a custom component which may
confuse it further by adding another layer.


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

"Ronald Kloverod" <ronald.kloverod (AT) xexcom (DOT) no> wrote in message
news:uv6eFRgeEHA.2804 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
DTS packages can be excuted "manually", or it can be run automatically
(for
example as a scheduled job under SqlServerAgent).

Question: Can I easily, in an ActiveX script task (VbScript), test for
what
"kind of" execution enviromment the package is executed under?

What I want is to prompt for som additional information when a
user-interface is available. If run automatically, such prompting will
force
the execution to stop - waiting for an answer.

Thanks for your help.
Ronald









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.