December 19, 2002 at 2:38 pm
Hi all,
This is really a couple of questions in one. We have a custom written VB com object that will amongst other things delete certain orders from the accounting system.
My question is;
is it possible to either call that com object from DTS and feed it order numnber one by one that come from a database OR
is it possible to do the same by sending a querystring to an ASP script page that will then call the com object.
Thanks for any responses...
Merry Christmas
Rolf
December 19, 2002 at 2:53 pm
If it is on the same machine then you can use ActiveScript within the DTS package, if remote there are the inet COM dlls that are part of windows or better the new xml install from MS has several ways to use doms to post (I haven't had time to explore the last one).
December 19, 2002 at 3:54 pm
Thanks for the leads, looking up activescript now. Do you know any good internet resources for activescript..?
Rolf
December 19, 2002 at 4:07 pm
Might try vbscript are on
http://www.planet-source-code.com
but I never found any myself, ended up writing what I wanted myself for this type situation. Mine is a paging app that does web pased posts of course it doesn't use the options I stated to you I simply because I wrote it 2 years ago and haven't updated it, problem then was nothing would get the return page data back and I ended up using the Internet control on a form.
December 19, 2002 at 4:11 pm
My other option is to create a VB script that can do pretty much most things via OLE/ADO and schedule that. I would like to use an SQL dts for its flexibility and portability to other SQL servers however.
Rolf
December 19, 2002 at 4:16 pm
Slightly crossed posts =)
I though activescript was some method within DTS specifically for sending stuff to a web page or com object =).
Tryiing to find some information on accessing a COM object from within DTS now, but most examples seem to focus on the other way round, exposing the DTS methods from a com object!
As I said above the easiest way to quickly achieve what I want to do is run a scheduled VBscript task, but that is open to all sorts of security and housekeeping nightmares.
Rolf
December 19, 2002 at 4:59 pm
ActiveScript is an design object you drop into the design of the DTS package, it is the wrapper for VBScript code that is all. Then you do the nightmare stuff there (wahahahahaha).
December 20, 2002 at 1:32 am
Cant find anything much about it in BOL =(.
Will give it a go today. Luckily its not a mission critical job, just something to save someone some time!
Hopefully I am understanding this object properly and I can just drop it into the DTS task and start sticking in VBscrip =) but i doubt its that easy.
Cheers
Rolf
December 20, 2002 at 5:58 am
I do suggest read the article in BOL titled "Using ActiveX Scripts in DTS"
There are a few keys to make it work properly other than what you normally do in VBScript.
You have to keep the main function and to return a success or failure you use
Main = DTSTaskExecResult_Failure
or
Main = DTSTaskExecResult_Success
December 20, 2002 at 6:35 am
I didnt realise that by activescript you meant ActiveX script! Dum really I should have guessed.
Already read that section then dived straight in ann built my VBscript code to read in a few recordsets and fire off the required stuff to the COM that does the real business. Worked a treat...only thing I had to change in the code was;
Set objOrderStatus = Server.createobject
to
Set objOrderStatus = createobject
If I run an SQL task before the ActiveX task does it fill a global array variable with the contents of any recordsets returned by the sql task..?
Rolf
December 20, 2002 at 12:20 pm
Unfortunately I have been stuck in the C++ world for the last year and never got to use anything in that realm so I cannot answer.
December 23, 2002 at 3:39 pm
I used that couple times with MSXML.
Set srvXmlHttp = CreateObject("Msxml2.ServerXMLHTTP")
...
srvXmlHttp.Open "GET", "http://....asp", false
srvXmlHttp.Send
...
Important stuff is to not forget connection timeouts (there are 4).
Also I call "Open" and "Send" inside Data Driven Query, but CreateObject I did once in ActiveScript in advance. That will save a lot if you combine SQL loop and COM dll.
If not there is a short cut to use sp_OACreate etc. and create custom HTTP call with the same MSXML or Win HTTP.
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply