Solved

5 seconds delay in classic ASP

Posted on 2009-04-08
2
4,027 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

632 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