Print Page | Close Window

how to update db every 25mins

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=11964
Printed Date: 28 March 2026 at 11:06pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: how to update db every 25mins
Posted By: asp what that??
Subject: how to update db every 25mins
Date Posted: 27 September 2004 at 8:00pm
what i am trying to do is do a calculation every 25 mins and have it added to the db every 25 mins...any idea on how to do this and keep track of the time?



Replies:
Posted By: michael
Date Posted: 27 September 2004 at 10:12pm
cannot do with pure asp unless you schedule it either to run an asp page every 25 min with event scheduler or have a windows service doing it for you.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: xeerex
Date Posted: 27 September 2004 at 10:23pm
OR set an refresh in the script and leave a browser running

OR do the same only use FF and the reload extension

OR write a quick VB app to "hit" the page every x minutes which runs the script




-------------
http://webspacegeeks.com - Need Hosting, Domains, Dedicated Servers?
http://www.smartergeek.com - web design | pc support | training | podcasts | video production


Posted By: pmormr
Date Posted: 27 September 2004 at 10:26pm
even better... copy the script... change a few things in it, and save it to .vb and schedule it to run every 25 minutes

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: asp what that??
Date Posted: 27 September 2004 at 10:29pm

would i count every 25 mins? or do a timediff??  like if minute(time) = minute(time) + 25 then do this script??



Posted By: asp what that??
Date Posted: 27 September 2004 at 10:30pm
it does not have to update the db...i just need to do some calc's every 25 mins...or how every many mins i decide...


Posted By: asp what that??
Date Posted: 27 September 2004 at 11:02pm
i figured it out...ty for your help


Posted By: dpyers
Date Posted: 28 September 2004 at 1:30pm

Originally posted by asp what that?? asp what that?? wrote:

i figured it out...ty for your help

What did you finally decide to do?



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: asp what that??
Date Posted: 28 September 2004 at 1:35pm
what i needed to do was give everyone in the db (X) about of credits per/ so many mins...  so what i am gonna do is on the home page when they log in...i will do a date/time stamp and add it to the db and then add a include file on every page that checks the time and updates the db with a new time ever (X) about of mins and then i will use that to add the credits... unless there is a better way LOL...im all ears ;)


Posted By: ljamal
Date Posted: 28 September 2004 at 2:35pm
are you using Access or SQL Server?
SQL Server has a scheduler

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: asp what that??
Date Posted: 28 September 2004 at 2:57pm

access...i have never used sql server



Posted By: asp what that??
Date Posted: 30 September 2004 at 7:04pm

bump*

i am not sure if this is gonna work...do you have any other ideas??



Posted By: Gullanian
Date Posted: 30 September 2004 at 7:44pm
Well, you only need to update credits everytime someone comes on the site.  This isn't probably very efficient, but it'll work for a small number of users.

In your users table, have 3 fields for each user:
 - Sign up date
 - Credits
 - Credit_accounted_for

Every page view the user does, calculate how many credits they should have.  If this is different than credit_accounted_for, then add the difference to credits field, and set credit_accounted_for to the new value.



Posted By: dpyers
Date Posted: 30 September 2004 at 7:54pm

Tou can use Session_OnStart sub in global.asa to check if it's time to run a script. The advantage is that it doesn't check for the time eerytime the home page is visited, but everytime someone visits the site. For some time periods though, you may have no one starting sessions.

If the script absolutely has to run at specified times, the best way is to either go with a host who has some in-house scheduling component, or drop a couple of bucks a month on a unix account with crontab capability. You can use cron to run the Lynx text browser on unix that runs an asp script on your windows account.

There was discussion about something similar in this thread - http://forums.webwiz.net/forum_posts.asp?TID=8923&PN=0&TPN=2 - http://forums.webwiz.net/forum_posts.asp?TID=89 23&PN=0&TPN=2



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: asp what that??
Date Posted: 30 September 2004 at 9:40pm
what i did was added 2 columns to the db...on that is the julian date and the other is the hour of the last update.  then i take and compair todays julian date and the hour...and i can use that do update the credits per user...i added a include file on all my pages so that it always does the check...


Posted By: asp what that??
Date Posted: 05 February 2009 at 9:10pm
hey guys its been a while but I'm back!

-------------
New Millennium Network Services
http://www.NMNetworkServices.com - http://www.NMNetworkServices.com
mailto:info@NMNetworkServices.com - My Email



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net