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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can an ASP page run at timed intervals?

Status
Not open for further replies.

SatishPutcha

Programmer
Mar 12, 2002
256
IN
Hi All

I have to create an ASP page that retrieves values from a database at 12 Midnight every day.

I need the page run all by itself at the specified time. Is there any way of doing this using only ASP(no dlls..nothing)?

thanks and regards
ek_freelancer
 
Typically the answer would be no, but, where this is a will there is a way. I usually write a vb app and schedule it. This got me to thinking. Could you just schedule the following statement in the windows scheduler to run at 12:00?

iexplore "yourpage.asp"

It works from the desktop, it may even work from the scheduler. I'll leave that up to you to try.

Chris.
 
You could have the page running constantly but only doing the ASP work at (or just after) 12...

That could by either checking the date and refreshing the page every 5 mins or it could be done by refreshing the page at 12.

Hope this may be of use.
 
Thank you Chris and DaveJunior. I will try both suggestions and get back to you.

However one thing seems clear that once the ASP starts then ir will not stop. Is this correct?

Regards
ek_freelancer
 
This belongs as a service on the server. The scheduler is an interesting idea, but VB is the way to go. I have an asp application, but some things I do are just better done as VB services.
 
In my opinion, you would not want to create an ASP page that ran for ever. The only way to do this is to either create a page that had an html refresh ever so often or ASP that looped indefinetely. Either way would require you to log on and start the process. The ASP looping would certainly cause CPU usage issues and both would be stop working if someone logged in and shut down the browser, the web server was reboot or stopped, and plenty of other system issues. You would then have to manually start it again.

As for my suggestion with scheduling IExplore, I had meant that the scheduler would kick it off at an interval and it would do it's processing and end until the next time the scheduler kick it off again. The downside to it is that when the scheduler started it, you may not be able to close the window. You could have multiple IE windows build up over time.

Really the best way is to create a VB app (or other language) and schedule it to run at the desired interval. Even creating a VB Script and run it through the WSH would be a better solution than ASP.

ASP was designed to dynamically create web pages to a user upon request.

Chris.
 
If you set up the scheduler than you could also set a maximum time on the application and force it to close after that amount of time. Basically you could give it a maximum of like two hours, byt that time it ought to be done with the processing anyways. Then the scheduler would kill the process (browser) when it hit the maximum time. The downside to this is that the scheduler would write an event to the event log every time it ran and killed tha browser at maximum time.

I would still say this sis something that should be done from an application rather than from an ASP page, as applications are designed to do things like this and ASP pages are not, but the above should help it work out as an ASP page also.

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top