Solved

running a timed asp page

Posted on 2001-08-31
9
251 Views
Last Modified: 2012-08-13
I am trying to build an ASP page that runs every so often (say hourly or once a day) that pulls pertinent information from a database and generates an email with that information.  I can't seem to find what I am looking for.  It looks like I can use the Windows Scripting Host but I don't want browser windows opening if possible.  I'm not real sure where to start.

Can anyone help?
Thanks,
Matt
0
Comment
Question by:mholocher
  • 2
  • 2
  • 2
  • +3
9 Comments
 
LVL 5

Expert Comment

by:raizon
ID: 6446317
I would create a VB app that ran my query and sent the email instead of an ASP page.  Then set that vb app up as a service in NT.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6446319
0
 

Author Comment

by:mholocher
ID: 6446333
I've have already read the 4Guys from Rolla information and it really wasn't what I was looking for.

As far as the VB app, what if I didn't have access to the actual server.  Say it was hosted at some hosting company somewhere.  Isn't there some other way to do it?

0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 28

Expert Comment

by:AzraSound
ID: 6446356
Not what youre looking for b/c you dont have access to the server?  Then you will be limited...there are some shady workarounds like this:

http://www.powerasp.com/content/hintstips/schedule-global.asp
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 6446365
You can use the Javascript 'setTimeOut()' function to run a page every so often;

<body onLoad="setTimeout('reDoPage()',600000)">

function reDoPage() {

window.location.reload(true);
}
0
 
LVL 10

Expert Comment

by:makerp
ID: 6447386
easy, simply have an asp page on the server that does the task then write a simple app that requests a web page using HTTP (set it request the web page that does you job). run this app on a machine you have control over. to schedule the local app us either the win98 scheduler or AT command on NT
0
 
LVL 10

Expert Comment

by:makerp
ID: 6447388
if you only have a PC at home and dont want to be dialed up all the time then your program will have to do the following

Dialup using the RAS API
request the page
Drop the connection

you could do all of this in C++ or WSH with the appropriate components
0
 
LVL 20

Accepted Solution

by:
Silvers5 earned 200 total points
ID: 6449702

How do I schedule ASP files?


Use the AT command and Windows Scripting Host to schedule a VBS file at certain intervals.
 
First, change the ASP to a VBS file. This is accomplished by (1) changing the extension to VBS; (2) changing all server.createobject calls to createobject; and, (3) removing all <%%> delimiters and any browser-destined code (for example, response.write statement or client-side HTML). I didn't run into any further complications, but YMMV.
 
You store the VBS file in the filesystem, and use the AT command to schedule it (this actually schedules its execution with NT's schedule service). At a command prompt, you can use AT by itself to see a list of tasks currently in the schedule. You can use AT /? to find out all its syntax possibilities.
 
For example, to get a file to run every weekday at 9:00 am, I launch this batch file (the first line clears existing entries):
 
    at /delete /y
    at 9:00 /every:m,t,w,th,f d:\net\shared\getdata.vbs
 
 
 
Notice there is no web server involved; the file is accessed directly through the file system. Once I got over the "a user has to be logged in" and "the tasks have to be reset when rebooted" hurdles (both of which I believe are problems with the particular machine that is not under our control), all has been running fine for me.
 

Kris Eiben suggests: If it's a high-traffic site, you might also be able to put something in session_OnStart, using an application variable with the last time the function was run and checking to see if the right amount of time has passed.
 

Build an ASP page and leave a browser open on the machine, with a <meta> refresh (ultimate kludge).



from aspfaq.com
0
 

Author Comment

by:mholocher
ID: 7438475
I decreased the point total because in one of my comments I stated that I didn't have control over the machine where the site is hosted.  I am giving the points based on the effort that was given to answer the question.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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