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