ADO lock type 
Author Message
 ADO lock type

Hello,

How I'm sure that no two individuals will be able to bring modification to
the same data...that was a earlier question.

I think this is a good solution for my application
Rs.CursorType = adOpenKeyset
Rs.LockType = adLockBatchOptimistic

but...

What's happend when two individuals bring modification to the same data
at the same time...one user will be fail or ???

Werner



Sun, 08 May 2005 01:53:57 GMT  
 ADO lock type

Hello,

How I'm sure that no two individuals will be able to bring modification to
the same data...that was a earlier question.

I think this is a good solution for my application
Rs.CursorType = adOpenKeyset
Rs.LockType = adLockBatchOptimistic

but...

What's happend when two individuals bring modification to the same data
at the same time...one user will be fail or ???

Yes, see the following if you are updating in batch mode:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado2...


Microsoft MVP (Visual Basic)



Sun, 08 May 2005 04:52:38 GMT  
 ADO lock type
Paul,

Thanks for your response, but is it possible to handel the error on this
way...
-------------------------------------------------
On Error GoTo updateError

Rs!Test = "Hello"
Rs.UpdateBatch
Rs.Close

Exit Sub

updateError:
Code
--------------------------------------------------
One user will be successful, the others will be fail...

Werner



Quote:


> Hello,
>
> How I'm sure that no two individuals will be able to bring modification
to
> the same data...that was a earlier question.
>
> I think this is a good solution for my application
> Rs.CursorType = adOpenKeyset
> Rs.LockType = adLockBatchOptimistic
>
> but...
>
> What's happend when two individuals bring modification to the same data
> at the same time...one user will be fail or ???
>

> Yes, see the following if you are updating in batch mode:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado2...
mdcondetectresolveconflicts.asp

- Show quoted text -

Quote:


> Microsoft MVP (Visual Basic)



Sun, 08 May 2005 11:05:44 GMT  
 ADO lock type

Paul,

Thanks for your response, but is it possible to handel the error on this
way...
-------------------------------------------------
On Error GoTo updateError

Rs!Test = "Hello"
Rs.UpdateBatch
Rs.Close

Exit Sub

updateError:
Code
--------------------------------------------------
One user will be successful, the others will be fail...

Werner

Your code should run the error handler if UpdateBatch fails because of an update conflict, but you
probably want to check the type of error that occurred as well.

It should be easy to test this by introducing a conflict (as in the example I posted)  and verify
that a trappable runtime error is generated.


Microsoft MVP (Visual Basic)



Mon, 09 May 2005 00:46:36 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ADO data types and vbasic data types mapping

2. ADO, text driver - ADO picks wrong data type...

3. Reversing Cap Lock Typing

4. Error cannot recognize .mdb type or Jet locked by another

5. Lock type with DBF tables.

6. RDO SQL SERVER (Lock type)

7. Question RE Cursor Types and Locking

8. Lock type with DBF tables.

9. Cursor types and locks in Rdo

10. Fast typing gets keyboard locked (sendkeys - numlock)

11. ado.net locking mechenism

12. ADO.Net Locking Mechanism

 

 
Powered by phpBB® Forum Software