Solved

5 seconds delay in classic ASP

Posted on 2009-04-08
2
3,172 Views
Last Modified: 2012-05-06
Hello guys,

I need an ASP file to perform a 5 seconds delay and read that database, until a field called STATUS equals to 10.

For example:

Do until Status=10
     Select STATUS from database
     status=database result
     5 SECONDS WAIT
loop

I want to put that 5 seconds wait before the database is queried again, so I don't overload the SQL server.

Thanks.
0
Comment
Question by:pvg1975
2 Comments
 
LVL 13

Accepted Solution

by:
ylandrum earned 500 total points
ID: 24104171
From http://www.aspfree.com/c/a/ASP-Code/Time-Delay-function-by-Michael-Wright/

<%
Sub Delay(DelaySeconds)
SecCount = 0
Sec2 = 0
While SecCount < DelaySeconds + 1
Sec1 = Second(Time())
If Sec1 <> Sec2 Then
Sec2 = Second(Time())
SecCount = SecCount + 1
End If
Wend
End Sub
%>

To call the function (sub):


Delay(The delay time)
E.g.

<% Delay(2) %>
0
 

Author Closing Comment

by:pvg1975
ID: 31568388
Thanks Ylandrum! It is working PERFECT!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# page opens in new window 3 55
An ASP query I cannot work out... 2 46
Help with stored procedure 30 59
ASP Sessions Being Cleared/Modified 6 65
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now