Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Database update
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Database update

 Post Reply Post Reply
Author
Scott07 View Drop Down
Groupie
Groupie


Joined: 04 July 2002
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scott07 Quote  Post ReplyReply Direct Link To This Post Topic: Database update
    Posted: 14 March 2003 at 2:23pm
How do i get a file to run every hour to update a database, its for my game yo update scores earn money ect and i want it to run every hour, the closest i have been able to get to it is by storing the time of the last update and running the file on every page which checked to see if it was time for the next update.  Is there a better way i can do theis then?
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2003 at 2:30pm
Setting up a scheduled task is the solution, there is nothing coding asp-wise that can be done to make sure its done on the hour...

but your method is pretty good..... if no one is there to see the page and an update doesn't happen, it well upon next hit
Contribute to the working anarchy we fondly call the Internet
Back to Top
Scott07 View Drop Down
Groupie
Groupie


Joined: 04 July 2002
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scott07 Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2003 at 2:36pm
not even in the asp.net stuff?  I dont mind how its done as long as it works and i dont have to be online 24 hours a day clicking a bug update button every hour
Back to Top
sespark View Drop Down
Newbie
Newbie
Avatar

Joined: 13 February 2003
Location: United States
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote sespark Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2003 at 2:45pm
The best way to do with asp would be to work your code so that it checks how much time is passed since the last time this function has run.  If it has been an hour, then it can do the updating before it does anything else.  If it has been more than an one hour, make it call the update repeatedly until it has caught up with the number of hours pasted.  Otherwise do nothing.  You could possible create something within an sql server to do that, a task per se, but I wouldn't know how to do that, and if you already know asp, it's a hassle to learn something else when you can do with asp.  ASP can only run when it is called.  It's compiled whenever someone tries to access the page in question.  Unless you have IIS setup with caching.  I hate caching.  *shudder*  That means it saves your ASP basically, so that it will compile only once for 10+, 100+, or more runs, and it will not update itself from the asp file until it has been called that many times.
Back to Top
Scott07 View Drop Down
Groupie
Groupie


Joined: 04 July 2002
Location: United Kingdom
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scott07 Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2003 at 3:40pm
so basicially in short the best way to do it, is the way i have been doing it where the function is run with every page and if it needs updating then it updates it
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2003 at 4:06pm
thats correct... because since IIS and serving up ASP pages is a passive thing, requiring some sort of action against it... there is no ability to natively run a task at a given time

as mentioned (and it appears you even remotely looked into it), there is a "Scheduled task" available that would do this.. but its up to you to spend a little effort to see if its doable

as for caching.. there's good times and bad times for it
Contribute to the working anarchy we fondly call the Internet
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2003 at 4:33pm
well there are task scheduler which are components and there is a very good one in .net. Depending on the database u use, if it's sql you can setup a job to run an update script or whatever you do at certain times, not hard to do if your host allows it.
Back to Top
boyohboy View Drop Down
Groupie
Groupie


Joined: 15 October 2002
Location: United States
Status: Offline
Points: 197
Post Options Post Options   Thanks (0) Thanks(0)   Quote boyohboy Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2003 at 2:08pm

ohk thanks Michael.

 

 

Visit my community website @
EverythingVIET.com
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.