Results 1 to 3 of 3

Thread: Automatic Execute Function

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2004
    Posts
    100

    Automatic Execute Function

    Hi all.
    I am developing ASP website and using MS Access as database.
    I have a create table function that is set to be executed at the end of month.
    I want the function to be executed automatically when the system is activated or may be someone log in to the system.
    Or, may be there is a way to automatically refresh the system so that the function will be executed.
    So, I want some ideas or opinion from anyone here, how can the function be executed automatically when it reaches the time set in the code?

    Thanks in advance.

  2. #2
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: Automatic Execute Function

    You can use Date Diff to compare the date with another date, maybe the last modified date of the Database file .. or even if you pull the date from a text file.

    The following says if a Variable Called FileModified is Older than 2 Days From the Current Date, then do something .

    VB Code:
    1. IF DateDiff("d", Now, FileModified) < -2 Then
    2.  
    3.    .. do something ...
    4.       .. update the last modified date ...
    5.  
    6. End If

  3. #3
    New Member
    Join Date
    May 2006
    Posts
    5

    Re: Automatic Execute Function

    Dear
    You can automatically refresh the page using javascript.
    There is code
    <script language="JavaScript">
    var sURL = unescape(window.location.pathname);
    function doLoad()
    {
    theMinutes="1"; //Input the minutes
    setTimeout( "refresh()",theMinutes*1000*60 );
    }
    function refresh()
    {

    window.location.href = sURL;
    }

    </script>

    <body onload="doLoad()">

Posting Permissions

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



Click Here to Expand Forum to Full Width