Results 1 to 2 of 2

Thread: 2 birds with 1 stone?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2002
    Posts
    4

    Question 2 birds with 1 stone?

    i have a question. is it possible to lock the same record in different forms in VB with only 1 active connection to the database?

    the senario is like this:
    i have an application with 2 (or more) forms which allow users to add, change & delete records from a database. when the users want to edit a record, it will be locked when they select the record they want to edit. the other user won't be able to change the records. this is fine with one active connection.

    but what if i want to make sure that both forms cannot edit the same record? is it possible to lock the record (using ADODB.Recordset) in form A and return an error that say the record is locked when form B tries to lock it (all this done with only one connection)? thanks.

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    If you are using ADO check the following properties on the recordset....

    - EditMode
    - State

    I think these change as you lock the recordset and you'd need some code to check them. Experiment and let us know ok ?


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

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