Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Using "LockType" property in ADO

Author  Topic 

DOlivastro
Starting Member

41 Posts

Posted - 2004-06-07 : 17:07:46
I'm confused about the LockType Property. I do the following:

sr.LockType = adLockPessimistic
set sr = s.Execute ("SELECT * FROM Table")

(In the above, s is a Connection Object open on SQL Server). When I look at sr.LockType, it suddenly changes to adLockReadOnly.

It is not a question of the provider, because the locktype works fine in the following:

call sr.open ("SELECT * FROM Table", s, , adLockPessimistic)

Why is this happening?
Dom

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-06-07 : 21:07:23
Just a thought....

Using the .Execute method by default returns a read-only recordset. This is normally used to execute things such as stored procedures that normally are read only.

If you want full control over the recordset, you need to use the .Open method - although it can be a bit verbose at times...

Tim
Go to Top of Page
   

- Advertisement -