Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Multi User in ADO

 
   Database Help (Home) -> Visual Basic RSS
Next:  Changing text in MS Access Macro with VB6  
Author Message
Prabhat

External


Since: Apr 07, 2004
Posts: 14



(Msg. 1) Posted: Wed Apr 14, 2004 12:27 am
Post subject: Multi User in ADO
Archived from groups: microsoft>public>vb>database (more info?)

How do I lock a particular record that one user has opened for editing?

If I use the pessimistic type, can other users view the record (but not
edit it) and return a message telling that another person is editing the
record, or does this type lock the record such that it is unavailable
until the editor releases it?

An explanation of pessimistic and optimistic lock types would be really
useful, as would some example code.

My project is to maintenance system with multiple users who can
all edit every record. However, I need to control the edit function so
that nobody edits a record that is in the process of being edited by
someone else. Also I Don't want to to use a Database Column for FLAG to
Maintain the Edit Mode.

Any ideas?
Thanks
Prabhat

 >> Stay informed about: Multi User in ADO 
Back to top
Login to vote
Ivan Dormain

External


Since: Jun 15, 2004
Posts: 4



(Msg. 2) Posted: Tue Jun 15, 2004 11:06 am
Post subject: Re: Multi User in ADO [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hey

I'd open the Recordset BatchOptimistic, then disconnect it, you could then
use the records state i.e (deleted, ammended, etc) to determine what to do
with it, now you can also verify if that
record has actually been altered, etc by someone else when you finally
commit the record. you can use BatchUpdate when performing any actions on
the record. This is with a disconnected recordset
though. Otherwise :

adLockBatchOptimistic 4 Indicates optimistic batch updates. Required
for batch update mode.
adLockOptimistic 3 Indicates optimistic locking, record by record. The
provider uses optimistic locking, locking records only when you call the
Update method.
adLockPessimistic 2 Indicates pessimistic locking, record by record.
The provider does what is necessary to ensure successful editing of the
records, usually by locking records at the data source immediately after
editing.
adLockReadOnly 1 Indicates read-only records. You cannot alter the
data.
adLockUnspecified -1 Does not specify a type of lock. For clones, the
clone is created with the same lock type as the original.


Constant Value Description
adOpenDynamic 2 Uses a dynamic cursor. Additions, changes, and
deletions by other users are visible, and all types of movement through the
Recordset are allowed, except for bookmarks, if the provider doesn't support
them.
adOpenForwardOnly 0 Default. Uses a forward-only cursor. Identical to
a static cursor, except that you can only scroll forward through records.
This improves performance when you need to make only one pass through a
Recordset.
adOpenKeyset 1 Uses a keyset cursor. Like a dynamic cursor, except
that you can't see records that other users add, although records that other
users delete are inaccessible from your Recordset. Data changes by other
users are still visible.
adOpenStatic 3 Uses a static cursor, which is a static copy of a set
of records that you can use to find data or generate reports. Additions,
changes, or deletions by other users are not visible.
adOpenUnspecified -1 Does not specify the type of cursor.




"Prabhat" wrote in message

> How do I lock a particular record that one user has opened for editing?
>
> If I use the pessimistic type, can other users view the record (but not
> edit it) and return a message telling that another person is editing the
> record, or does this type lock the record such that it is unavailable
> until the editor releases it?
>
> An explanation of pessimistic and optimistic lock types would be really
> useful, as would some example code.
>
> My project is to maintenance system with multiple users who can
> all edit every record. However, I need to control the edit function so
> that nobody edits a record that is in the process of being edited by
> someone else. Also I Don't want to to use a Database Column for FLAG to
> Maintain the Edit Mode.
>
> Any ideas?
> Thanks
> Prabhat
>
>

 >> Stay informed about: Multi User in ADO 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Create a database when a user logs in for the first time - Hi, Looking for some ideas ? ADO / RDO ? I need to develope a visual basic application that when a user launches the application it checks to see if the datase for the user is created if the user does not have a DATABASE it creates one then creates a...

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...

arrays - is there a way to concatenate the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a datareport for example after 5 records printed. Thank you all

Possible Use of a Cursor - I have a complex query that I hope I can explain it well enough for everyone to understand. I have a table that contains information for work instructions. Contained in the table are "MACHINE_PROC" these are groupings of machining processes....
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]