ADO not releasing row level lock after .Update 
Author Message
 ADO not releasing row level lock after .Update

I am using SQL Server 7 with ADO 2.5. I am opening a recordset with the
following code:

Set rst = New ADODB.Recordset

With rst
    .CursorLocation = adUseServer
    .CursorType = adOpenDynamic
    .LockType = adLockPessimistic
    .Open "Select * from tblLibraryIndexPoint Where id = 1", Conn
End With

When I call rst!Name = 'John' the record is been locked (which is correct).
However when I call rst.Update the lock is not been released. It is not
released until I close the recordset. I have tried using different isolation
levels on the connection object.

Does anybody know why and how I can force the lock to be released without
closing the recordset?



Sat, 11 Jan 2003 03:00:00 GMT  
 ADO not releasing row level lock after .Update
Have you tried just moving to the next record?


Quote:
> I am using SQL Server 7 with ADO 2.5. I am opening a recordset with the
> following code:

> Set rst = New ADODB.Recordset

> With rst
>     .CursorLocation = adUseServer
>     .CursorType = adOpenDynamic
>     .LockType = adLockPessimistic
>     .Open "Select * from tblLibraryIndexPoint Where id = 1", Conn
> End With

> When I call rst!Name = 'John' the record is been locked (which is
correct).
> However when I call rst.Update the lock is not been released. It is not
> released until I close the recordset. I have tried using different
isolation
> levels on the connection object.

> Does anybody know why and how I can force the lock to be released without
> closing the recordset?



Sat, 11 Jan 2003 03:00:00 GMT  
 ADO not releasing row level lock after .Update

I would use SQl Profiler to see what's happening.. will likely make things
obvious...

--
Brian Moran
CrossTier.com
MS SQL Server MVP
SQL Server Mag Columnist


Quote:
> Have you tried just moving to the next record?



> > I am using SQL Server 7 with ADO 2.5. I am opening a recordset with the
> > following code:

> > Set rst = New ADODB.Recordset

> > With rst
> >     .CursorLocation = adUseServer
> >     .CursorType = adOpenDynamic
> >     .LockType = adLockPessimistic
> >     .Open "Select * from tblLibraryIndexPoint Where id = 1", Conn
> > End With

> > When I call rst!Name = 'John' the record is been locked (which is
> correct).
> > However when I call rst.Update the lock is not been released. It is not
> > released until I close the recordset. I have tried using different
> isolation
> > levels on the connection object.

> > Does anybody know why and how I can force the lock to be released
without
> > closing the recordset?



Sat, 11 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How do I apply row-level locking in SQL server with ADO

2. Row level locking use system stored procedure via ADO

3. ADO Error : The specified row could not be located for updating

4. ADO Error : The specified row could not be located for updating

5. Access 97 Row-Level Record Locking

6. row-level locking with dao and access 2000

7. Command Object vs Connection Object for Row Level Locking

8. Command Object vs Connection Object for Row Level Locking

9. Row Level Locking Help???

10. Row level locking with an Access 97 DB ?

11. Row Level Locking

12. How to do record/row level locking?

 

 
Powered by phpBB® Forum Software