Solved

5 seconds delay in classic ASP

Posted on 2009-04-08
2
3,311 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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