Limit User

Discussion in 'ASP General' started by John Peter, Sep 12, 2003.

  1. John Peter

    John Peter Guest

    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
     
    John Peter, Sep 12, 2003
    #1
    1. Advertising

  2. John Peter

    Tom B Guest

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

    "John Peter" <> wrote in message
    news:%...
    > 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
    >
    >
     
    Tom B, Sep 12, 2003
    #2
    1. Advertising

  3. John Peter

    dlbjr Guest

    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
     
    dlbjr, Sep 13, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cw
    Replies:
    1
    Views:
    635
    James J. Foster
    Jun 27, 2003
  2. Replies:
    0
    Views:
    2,283
  3. User
    Replies:
    2
    Views:
    378
    Chris Wright
    Oct 17, 2004
  4. Bob
    Replies:
    2
    Views:
    564
  5. Replies:
    1
    Views:
    1,134
    Victor Bazarov
    Jun 28, 2005
Loading...

Share This Page