Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Jun 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP Database to avoid duplicate work

    having a database to insert and select let's you be able to edit, add and delete information. But if this page is accessible to several employee's and you want to somehow add a button or a read only method that lets other know that someoned is currently viewing/working on this profile, so that you can select another record from the list, is there a way to do this?

  • #2
    New Coder
    Join Date
    Jun 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if this can't be done in ASP, maybe in javascript?

    where it would say: Status: Open [means someoned is accessing the URL]
    or Status: Close [the file is available to view]

    ID Contact Name Delete Status: Close <---example, if the status is open, that means the person will get an alert when trying to click on the link "contact name"

    I dont have a code for this, has I dont even know if it is possible to do so.

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Posts
    120
    Thanks
    0
    Thanked 3 Times in 3 Posts
    What if a user open a record and doesn't edit it for hours? Or if they close the browser window? How can you tell if the record is still in use?

    Tom

  • #4
    New Coder
    Join Date
    Jun 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the records is display in a .asp file, so if an IT person is viewing the page, it will have to detect that this URL (ID) is currently open, if not it is available?

    something like:

    <a href="databasesite.asp?id=<&#37;= rsdatas("ID") %>">Name</a>

    is restricted to only 1 user to click on that specific ID, if ID45 is open by a user (IP detection) then another ID from the list might be available to view.

    any idea?

  • #5
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    You'll need to add fields to your record for both the timestamp of when the record was requested for updating, and for the session ID of the user that did the requesting. You need to allow for users making multiple requests, and for users that don't end their sessions as expected; this last one is especially problematic as you can't rely on Session_OnEnd firing on all occassions. So you're going to need to check, when someone requests a record for updating, not only whether another user has got it 'open' but when they 'opened' it - and if that users' session can be reasonably expected to have expired in the meantime, thus enabling you to 'close' all the records opened under that session ID.

    In short, it's a bit complicated.

  • #6
    Regular Coder
    Join Date
    Sep 2007
    Posts
    120
    Thanks
    0
    Thanked 3 Times in 3 Posts
    @Spudhead: That's what I was trying to explain to the OP. And how do you test for expired sessions when the user has left your site?

    Tom

  • #7
    New Coder
    Join Date
    Jun 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    perhaps there is a site that explain the process of doing so...if I would to search, what title would I use to search:

    expired sessions
    database id record restriction

  • #8
    Regular Coder
    Join Date
    Sep 2007
    Posts
    120
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Hi,

    Here's you'll find a example in dutch:

    http://www.aspnl.com/aspnl/nl/artikelen/reclocksasp.asp

    Even without understanding the explanation it's pretty straightforward. The last part warns about the problem mentioned by Spudhead.

    HTH, Tom

  • #9
    New Coder
    Join Date
    Jun 2004
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks, Ill look into it, and I dont understand dutch, if you find an english page, let me know


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •