Re: Creating a DTS ActiveX Task

From: mgm (mgm_at_discussions.microsoft.com)
Date: 09/16/04


Date: Thu, 16 Sep 2004 15:15:04 -0700

By the way, I just found an error when I try to execute it manually. It says
"variable undefined: WScript" can I not use WScript objects such as
CDO.message?

"alien2_51" <dan.billow"at" wrote:

> The Main function in the active x script is the entry point, you must write
> code to do something from here, otherwise nothihng will happen also if you
> do not return DTSTaskExecResult_Success from this function the step will
> show as failing, this is why this is the only line in the default script.
> Schedule the DTS package by right clicking and selecting Schedule Packsge,
> once this is done you can modify the schedule or disable the job from the
> Management>SQL Agent>Jobs in EM. Keep in mind this package will run in the
> context of the SQL Agent service account when run from a job.
>
>
> "mgm" <mgm@discussions.microsoft.com> wrote in message
> news:E3D5A713-3A09-44B8-8B55-A80BF7157D9A@microsoft.com...
> > I've never used DTS and was wondering how to schedule a script to run. I
> > notice when you open an ActiveX Script Task it's formated like this:
> > Function Main()
> > Main = DTSTaskExecResult_Success
> > End Function
> >
> > I wrote a script that will query a database and send a mail to certain
> > recipients with the results in the mail (using CDO). The query works when
> I
> > run it, but I don't know how to schedule it. I pasted my code into the
> > ActiveX Script Task with and without the "Function Main()..." and it won't
> > work.
> >
> > After I schedule it to run I look in SQL Server Agent - Jobs and it says:
> > The job failed. The Job was invoked by Schedule 12 (Name of DTS Package).
> > The last step to run was step 1 (Name of DTS Package).
> >
> > Can anyone help me get my script to run automatically on a daily basis -
> > whether using DTS or not?
> >
> > Thanks!
>
>
>



Relevant Pages

  • Re: Creating a DTS ActiveX Task
    ... The Main function in the active x script is the entry point, ... Schedule the DTS package by right clicking and selecting Schedule Packsge, ... > notice when you open an ActiveX Script Task it's formated like this: ...
    (microsoft.public.sqlserver.programming)
  • How to import SharePoint List data into SQL Server?
    ... Is there a recommended way to schedule the transfer of data from a ... DTS doesn't seem to have any ... SOAP Toolkit COM objects be used in an Active X script? ... SQL Server 2005, there is a trivial solution for this scenario? ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Synchornize date script
    ... I create an account called schedule, ... the script works just fine. ... synchronize with external time source. ...
    (microsoft.public.scripting.vbscript)
  • strange error on DTS scheduling
    ... I am getting this strange error while scheduling a DTS. ... What I am trying to do is copy data from DB2 on mainframe to a SQL ... I added the domain/SQLADMIN to Admin group in the server. ... When I schedule it as a job. ...
    (microsoft.public.sqlserver.dts)
  • strange error on DTS scheduling
    ... I am getting this strange error while scheduling a DTS. ... What I am trying to do is copy data from DB2 on mainframe to a SQL ... I added the domain/SQLADMIN to Admin group in the server. ... When I schedule it as a job. ...
    (microsoft.public.sqlserver.server)

Loading