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)
 ROWLOCK in SELECT statement vs adLock as param in Open statement

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-04 : 08:42:41
Greg writes "I have ADODB code as follows:

Dim cnn as ADODB.Connection
Dim cmm as ADODB.Command
Dim RS as ADODB.Recordset

Set cnn as GetConnection (connection to sql 2000 DB)
Set cmm as new ADODB.Command
cmm.activeconnection = cnn
cmm.commandtype = adCmdText
cmm.CommandText="SELECT row1, row2 FROM tablename WITH (ROWLOCK) WHERE row1='lname';"

Set RS = new ADODB.Recordset
RS.Open cmm, ,adOpenStatic, adLockOptimistic


My question is - Does the adLockOptimistic override the WITH (ROWLOCK)?

Your help is appreciated. Thank you.

OS: 2000 server"
   

- Advertisement -