dbTalk Databases Forums  

Other APIs in ActiveX scripts

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


Discuss Other APIs in ActiveX scripts in the microsoft.public.sqlserver.dts forum.



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

Default Other APIs in ActiveX scripts - 09-11-2003 , 08:30 AM






Is there a way of calling other APIs in ActiveX script?
I'm not a scripting expert so don't know the answer to
this.

If so, how do you do it? Is it something to do with
CreateObject()?

TIA

cheers
Jamie


Reply With Quote
  #2  
Old   
Dirc
 
Posts: n/a

Default Re: Other APIs in ActiveX scripts - 09-11-2003 , 10:34 AM






On Thu, 11 Sep 2003 06:30:38 -0700, "Jamie Thomson" <jamiet (AT) int21 (DOT) com>
wrote:

Quote:
Is there a way of calling other APIs in ActiveX script?
I'm not a scripting expert so don't know the answer to
this.

If so, how do you do it? Is it something to do with
CreateObject()?

TIA

cheers
Jamie

That's it exactly... you can use this two ways:

Use a script or external appllication to manipulate and run DTS
packages.

Or, from within a DTS package, you can use scripting tasks (Using
VBScript) to do the same.

Everything you can do in a DTS package you can do programmatically
using the API. Look in SQL Server Books On-Line at the DTS Object
Model for more details, then have a look at http://www.sqldts.com for
other snippets of information.

Dirc


Reply With Quote
  #3  
Old   
Narayana Vyas Kondreddi
 
Posts: n/a

Default Re: Other APIs in ActiveX scripts - 09-11-2003 , 11:04 AM



If you are talking about instantiating COM objects, yes you use
CreateObject. Just search sqldts.com for createobject and you see examples.
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
What hardware is your SQL Server running on?
http://vyaskn.tripod.com/poll.htm


"Jamie Thomson" <jamiet (AT) int21 (DOT) com> wrote

Is there a way of calling other APIs in ActiveX script?
I'm not a scripting expert so don't know the answer to
this.

If so, how do you do it? Is it something to do with
CreateObject()?

TIA

cheers
Jamie



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

Default Re: Other APIs in ActiveX scripts - 09-11-2003 , 01:20 PM



In article <077b01c3787c$d6513570$a001280a (AT) phx (DOT) gbl>, Jamie Thomson
<jamiet (AT) int21 (DOT) com> writes
Quote:
Thanks Dirc but thats not exactly what I meant - my fault,
I should have explained myself better.

Probably would have been alot simpler if I'd have said:

Can I call other COM objects from an ActiveX script within
DTS?

cheers
Jamie

You can use just about any COM object from an ActiveX Script, through
CreateObject, but you cannot use Win32 APIs that use the "Declare
Function GetSaveFileName Lib "comdlg32.dll" _
Alias "GetSaveFileNameA" _
(pOpenfilename As OPENFILENAME) As Long" style syntax. This requires a
strongly typed language, such as VB. You can wrap up calls to these APIs
in VB for example, and build a COM object (ActiveX DLL Project) that can
then be used in ActiveX Script.

There are some samples of CreateObject here-

Working with files and the FileSystemObject
(http://www.sqldts.com/default.aspx?292)

The key knowing which COM object you need, by the ProgID, Object.Class
and then obviously having a rough idea of what you want to do with it.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



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.