Results 1 to 13 of 13

Thread: Can this be done?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Talking

    I will have multiple user accessing a database at one time. If a user is editing a record, and another user happens to select the same record to edit, is theire a way to flag user #2 that the record is currently being edited and not allow him acccess at that time? Kinda of a freezing of the record, or readonly of the record.

    Any ideas?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  2. #2
    Lively Member
    Join Date
    Aug 2000
    Posts
    114
    What kind of database are you using?

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Cool duh,

    Yeh. I'm sure that would help. Sorry. I am using an Access 2000 database.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  4. #4
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    you know james..

    i have wanted to ask that for SOOOO long
    i just couldnt' come up with the right words
    YOU SEE WHAT TOO MUCH THINKING DOES TO YOU? -

    i would be interestd in the answer as wel... thanks
    am using ADO..

    right now i have a table to stores what user is doing what..
    but i dont think this is efficient...

  5. #5
    Guest
    DAO: When you open the recordset, use the dbPessimistic option. It will lock the record when you call the .edit method.

    ADO: use the adLockPessimistic option when you call recordset.open




    [Edited by RoyceWindsor1 on 09-14-2000 at 11:03 AM]

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Talking what about ADO?

    My coonect string is cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
    "Data Source=" & GroupsDatabase

    How would I do it?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  7. #7
    Lively Member
    Join Date
    Aug 2000
    Posts
    114
    Make sure you put an 'on error goto errhander' statement in when you do the edit because if the record is locked then you will get an error and all you will have to do is just display the error to the user.

  8. #8
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    what happens?

    so what will be thrown at the user if they try to open a record for edit (since ado doesnt have .EDIT) then they are gonna use .OPEN

    in simplicity..
    how can we(i) let only one user edit a record using ADO..
    thanks

    hope that helps james

  9. #9

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Question

    Kovan: better way of explaining.

    Everyone: If it can be handled through error control, how woluld we (myself,kovan, and eveyone else) know what do display. What I mean is, how can I trap that type of error, since an error with databses can occur in other ways?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    kovan, since you seemed interested

    Here is the way I will fix my delima.

    In my database, added another "yes/no field" name "Allowedit". When a user opens the record, I will update the feild to "NO". I will turn it to "YES" when that record is completed. Then, when a user goes to edit a record, check the status of the Allowedit field.

    Your comments?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  11. #11
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736

    Lightbulb

    Just a suggestion. I have not used it yet, since I am still learning this language, but there is an editmode property for a recordset that may be of use to you.

    Check out MSDN for more details on it. Search on ADO editmode.

    Or just go here >>> http://msdn.microsoft.com/library/ps...k/mdap09gl.htm

  12. #12
    Junior Member
    Join Date
    Sep 2000
    Location
    Calgary, Albetra, Canada
    Posts
    19

    Talking Pessimistic locking

    In the database options you can set a flag that tells the database to use pessimistic locking. If this flag is clicked and a user goes to a record that is being edited by another user then on the left hand side of the form, usualy where the pencil appears if a record is being editted, a slashed out circle will appear. This indicates that the record is locked. I am not sure if the user can change the data but if he/she can the data will not be saved. In the Access 2000 book I have at home there is some code that will do some really cool stuff in this area ... ex: example on how to put a time limit on a locked record and if after a certain amoutn of time the record has not been saved, then the code undoes any changes to that record and then removes the lock ...

    The above option only works with the jet ... but to use it with ADO, RDO or DAO you just have add a parameter to your connect string.

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Talking

    All: Thanks for the info.
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

Posting Permissions

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



Click Here to Expand Forum to Full Width