[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ASP Task Scedule Windows 2003 Server

Posted on 2009-12-17
3
Medium Priority
?
254 Views
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
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#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")
URLShort=(Recepients("JBSURLShort"))
URLLong= (Recepients("JBSURL")) & "/coms/em/aemail.asp?ID=" & Recepients("JBEID")
ReplyMail=(Recepients("JBSNoReplyEmail"))
myMail.Subject= "You have jobs on " & URLShort & " that expire today"
myMail.From= ReplyMail
myMail.To= ""& Recepients("JBEUsername")&"; "
myMail.CreateMHTMLBody URLLong
myMail.Send
set myMail=nothing
Recepients.MoveNext 
Loop
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)
ExpirySent.Execute()

%>
<%

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)
Copyadverts.Execute()

%>
<%

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)
DeleteAdverts.Execute()

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

Open in new window

0
Comment
Question by:garethtnash
3 Comments
 
LVL 13

Accepted Solution

by:
samic400 earned 1000 total points
ID: 26072840
We do this stuff quite a bit - follow this tutorial and just point to the page you want to run - http://www.iopus.com/guides/winscheduler.htm
0
 
LVL 12

Assisted Solution

by:Ashley Bryant
Ashley Bryant earned 1000 total points
ID: 26072870
Have you tried using cURL?
0
 

Author Closing Comment

by:garethtnash
ID: 31667269
thank you
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

826 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