ASP Task Scedule Windows 2003 Server

Posted on 2009-12-17
Last Modified: 2012-05-08
Hello Experts,

I have an ASP VBScript page, that basically calls a number of MS SQL Stored Procedures, and an ASP function and actions the following -

Selects recepients
Emails recipients
Flags that notification has been sent
copies any expired data to an expired data table
deletes the expired data from the live table...

the ASP page isn't specific to any particular website as it runs the processes above in one batch for all websites on the server.

I really want to be able to use task sceduler to execute the asp scripts on a daily basis..

Any thoughts on this would be great?

Thank you

<!--#include file="../Connections/recruta2.asp" -->


set JBNotify = Server.CreateObject("ADODB.Command")

JBNotify.ActiveConnection = MM_recruta2_STRING

JBNotify.CommandText = "dbo.jobboardExpiryNotificationRecipients"

JBNotify.CommandType = 4

JBNotify.CommandTimeout = 0

JBNotify.Prepared = true

JBNotify.Parameters.Append JBNotify.CreateParameter("@RETURN_VALUE", 3, 4)

set Recepients = JBNotify.Execute

Recepients_numRows = 0



if not Recepients.eof then

do while not Recepients.eof

Set myMail=CreateObject("CDO.Message")


URLLong= (Recepients("JBSURL")) & "/coms/em/aemail.asp?ID=" & Recepients("JBEID")


myMail.Subject= "You have jobs on " & URLShort & " that expire today"

myMail.From= ReplyMail

myMail.To= ""& Recepients("JBEUsername")&"; "

myMail.CreateMHTMLBody URLLong


set myMail=nothing



Set Recepients = nothing 

end if



set ExpirySent = Server.CreateObject("ADODB.Command")

ExpirySent.ActiveConnection = MM_recruta2_STRING

ExpirySent.CommandText = "dbo.jobboardExpiryNotificationSent"

ExpirySent.CommandType = 4

ExpirySent.CommandTimeout = 0

ExpirySent.Prepared = true

ExpirySent.Parameters.Append ExpirySent.CreateParameter("@RETURN_VALUE", 3, 4)




set Copyadverts = Server.CreateObject("ADODB.Command")

Copyadverts.ActiveConnection = MM_recruta2_STRING

Copyadverts.CommandText = "dbo.JobboardMoveExpiredAdvertsStage1"

Copyadverts.CommandType = 4

Copyadverts.CommandTimeout = 0

Copyadverts.Prepared = true

Copyadverts.Parameters.Append Copyadverts.CreateParameter("@RETURN_VALUE", 3, 4)




set DeleteAdverts = Server.CreateObject("ADODB.Command")

DeleteAdverts.ActiveConnection = MM_recruta2_STRING

DeleteAdverts.CommandText = "dbo.JobboardMoveExpiredAdvertsStage2"

DeleteAdverts.CommandType = 4

DeleteAdverts.CommandTimeout = 0

DeleteAdverts.Prepared = true

DeleteAdverts.Parameters.Append DeleteAdverts.CreateParameter("@RETURN_VALUE", 3, 4)



<% Response.Redirect"mailsent.asp" %>

Open in new window

Question by:garethtnash
    LVL 13

    Accepted Solution

    We do this stuff quite a bit - follow this tutorial and just point to the page you want to run -
    LVL 12

    Assisted Solution

    Have you tried using cURL?

    Author Closing Comment

    thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now