|
-
May 14th, 2006, 08:38 PM
#1
Thread Starter
Lively Member
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.
-
May 15th, 2006, 05:30 AM
#2
PowerPoster
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:
IF DateDiff("d", Now, FileModified) < -2 Then
.. do something ...
.. update the last modified date ...
End If
-
May 15th, 2006, 08:02 AM
#3
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|