Limit User

J

John Peter

How can i limit the number of users on my .ASP page, i want only one user to
be using the page at a time,

The query i have on my page is big and takes a lot of my system resources.

John
 
T

Tom B

<%
Application.Lock
if Application("InUse")="Yes" then
Response.Write "In Use"
Response.End
else
Application("InUse")="Yes"
end if
Application.Unlock
%>
 
D

dlbjr

I disagree with Tom.

If the Application is locked while the code is processing no other client
will get to the application to even get a busy message.

Try this:

At the Top of the Page Place this Code:

If Not Application("PageInUse") Then
Application.Lock
Application("PageInUse") = True
Application.UnLock
Else
Response.Write "Page In Use"
'Redirect if needed
Response.End
End If

At the Bottom of the Page Place this Code:

Application.Lock
Application("PageInUse") = False
Application.UnLock



-dlbjr

invariable unerring alien
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top