codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  automatic updating  Archive Import (diego) at 05:46 on Wednesday, August 13, 2003
 

i want to ask a script on how to update every month to a certain fields without clicking any button or link.

the leaveBal(field) will update or add 1.1 every month without clicking any button or link.

How is that?

thanks and more power!!!!!!!!
diego

  Re: automatic updating  Troy Wolf at 11:15 on Wednesday, August 13, 2003
 

I think I need more detail on what you want. Is the field you want to work with stored in a database? Is it a numeric field that you want to adjust once per month?
Troy Wolf: site expert
SnippetEdit Website Editor


  Re: automatic updating  Archive Import (diego) at 20:25 on Wednesday, August 13, 2003
 

yes it will store in the database and the datatype of the field is nvarchar.

  Re: automatic updating  Troy Wolf at 12:39 on Friday, August 15, 2003
 

Diego, please try to provide as many details as possible. The type of database makes a difference in the options available to you. For example, if you are using SQL Server, I would suggest you create a SQL Server Agent job. You can schedule it to run on the first of every month with code that updates your records. If you are working with Access, I don`t know of any built in scheduling features, so write a VBScript to update your records, then use Windows Task Scheduler or the "at" command to schedule your script to run once per month. If this is a database server hosted remotely at a hosting company and you do not have access to schedule scripts, then you still have some options.

One method is to go ahead and create a VBScript to update the records. Have it scheduled to run monthly on a local computer. This can be a weak link, though, if the local computer is not running or the Internet connection between the local script and the remote database is down.

Another option is to not worry about updating the database until somebody wants to look. (If a tree falls in the forest, and nobody is there to hear it, does it make a sound?) Here`s what I mean: If you want the data to update on the 1st of every month, does it matter if it really updates on the first? Or just as long as it updates each month BEFORE somebody looks at the data? You can create a table with a single record and a single column that simply stores the date of the last update. When people access your page(s), check this date. If the date is more than 30 days old, run your update query before processing the normal ASP page. The last thing your update script does is update the single cell with the current datetime. If you have multiple ASP pages that query the data, create an include file that is included at the top of all your pages. It will check the date and update if necessary.

If your site is accessed heavily, then you need to be concerned about the update process running more than once at nearly the same time. i.e. Two people hit the site at the same time, the update starts, and then the second person causes the update to start a second time because the first update has not completed and updated the datetime cell yet. Perhaps you have your update script store tomorrow`s date at the beginning of the script, then store the current timestamp when complete. If your update process takes several seconds, this will keep additional hits from firing the update process. Of course, then those additional hits would be looking at old data.....so now you need to script your update check code so that if the date is greater than right now, then tell the user that an update is in progress, please try to load the page again in 1 minute. Unless you have a VERY busy site and your update script takes several seconds or even minutes to run, this should almost never occur, but you want to have code to handle it just in case. Get creative--I haven`t thought this out all the way, but you`ll find a good solution!

Does this solve your problem, Diego?
Troy Wolf: site expert
SnippetEdit Website Editor


  Re: automatic updating  Elain at 04:24 on Friday, January 14, 2011
 

I'n not very good at about this!
I think you should upload the new link which it can link your product.
Hope can help you!
_______________________________________________
decompiler for mac|tree menu|flash banner








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Doubles .toString Error: double cannot be dereferenced.
•  Re: What VBA code can I use to extract the IP Address
•  Re: difference between activex dll and an exe
•  Re: New user, trying to figure out how `find` works....
•  Re: adding a querystring parameter in a button click event
•  Re: onclick thumbnail images in gridview or datalist
•  Re: MDI form open size and location
•  Re: where can i download javax.speech package
•  Re: need help with main()


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2011