Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP Page Run Nightly

Status
Not open for further replies.

csiwa28

Programmer
Apr 12, 2001
177
Hi everyone,

I currently have a database with a table called 'Members' and the fields are 'Member_name', 'Member_email', 'Member_join_date'. What I would like to do is create an asp page that would execute nightly and what it would do is select all the members that joined that day and send out a welcome message email to them. Is that possible? If not, any suggestions?
 
make a vbs that runs on the server via task scheduler

easiest solution i can think of and it's single fire versus making something that's web page based that fires on the first hit after a certain time, problem is , cant be guaranteed a hit at a certain time, OR possibilities of doublefires, it happens.

[thumbsup2]DreX
aKa - Robert
 
I have a script that i use in windows shell
i can;t get to server i try tomorrow and send you an example

its basic a vbs....script that you use to go to
and it will process your asp page
You set the vbs up in the task manager.
 
lmao
nice uhm link... i needed some pr0n at work :)

i thought that was some link to a component or something
[rofl]

[thumbsup2]DreX
aKa - Robert
 
One thing that I have done in the past is to just send out the welcome note after they set up there account. That way you don't have to worry about your page not being kicked off or being done twice. You can just add a server side include that is only kicked off after they have succesfully joined.
 
Gosh did not mean to do it as that lol

Option Explicit

' Declare our vars
Dim objWinHttp, strURL, strStatus, subject, body, WshShell, x

'------- Request URL from 1st Command Line Argument. This is a nice option so you can use the same file to
'------- schedule any number of differnet scripts just by changing the command line parameter.

strURL = WScript.Arguments(1)

'------- Could also hard code if you want:
strURL = "
Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5")
objWinHttp.Open "GET", strURL
objWinHttp.Send

subject = objWinHttp.Status
body = "WEB_CHECKED"
'WScript.echo "Subject and Body " & subject & body 'Show the user the name entere

'------------This email used for declaring a variable Subject and Variable Body
Set WshShell = WScript.CreateObject("WScript.Shell")
x=WshShell.Run("smail " & subject & " " & body ,0,TRUE)

'--------------Clear out the object
Set objWinHttp = Nothing


Just save this as it is in notepad.

Then in your task schedule.....call myfile.vbs
 
Naughty girl. [blush] (just kidding)
BTW, If csiwa28 is using SQL server, the necessary vbsript can be nicely setup inside the SQL Server Agent.
 
if he is using SQL server, he could make a DTS package and schedule it as a job.
 
So you are saying that inside SQL you can set up a DTS package to run an vbs script..that will call the ASP
Inside of SQL

I know you can schedule jobs in SQL but did not know you could call a vbs windows script ?

 
Yes, you have to save it as ASP file.
A customizable job will be created inside the SQL server agent when the ASP file is run. So you should run this ASP code only once to create that job. Once created, you can open that job and change any settings (like the schedule of run) from within SQL enterprise manager.
 
Oh just recapping here..

Lets say i have normal asp page that
read a recordset and updates a table

I call this update.asp

So i go into DTS create a job and do execute
update.asp page at 10 pm

Then each night the SQL will run the ASP page

If so that is pretty sweet and you do not need the vbs....
I have to try that out.....

I usually sit at my desk writing sql updates and spend all week writing it where as i could write ASP in a flash and then let SQL call it

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top