SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    epsom
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Run code once based on date + asp

    Hi

    i was wondering if anyone could tell me how to run code once based on date.

    I have an application that i want to update a database based on the particular month.

    Any ideas?

    Thanks

    Nicholas

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    So when it hits say JUNE you want to execute a set script to run only once and that's it? You would be better of either creating a VBScript on a scheduled task, or a DTS package provided your using SQL Server.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    epsom
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Thing

    I have already found out about that - to have VB script i need access to the server and this is not possible as it is hosted somewhere else and lastly im not running SQL server as im using Access for now!

    Any ideas?

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why don't you use a global.asa. On the on session start, which is when each visitor starts viewing your site. Basically add your coding, so that if month(now) = "7" and update = 0 then

    Basically it will check each time a user visits the page. Once it updates it will add 1 to that table, saying its been updated for that month, which means it wont be updated again.

    Gav

  5. #5
    SitePoint Evangelist luxinterior's Avatar
    Join Date
    Aug 2004
    Location
    Here, there and everywhere!
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you don't have access to the server and you only want the code to run in the one month then gRoberts is a good solution. If you want to execute it more often you could try a service like www.cronservice.co.uk

    Good Luck

    Lux


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •