Microsoft KB Archive/182954

= PRB: rdConcurRowver Availability Incorrect in Books Online =

Article ID: 182954

Article Last Modified on 11/7/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q182954



SYMPTOMS
Books Online indicates that rdConcurRowVer can be used for a table that has only an ID or a timestamp. rdConcurRowVer changes to rdConcurValues when opening a server-side cursor on a table that has only a timestamp or only an ID.



CAUSE
The locktype argument specifies the type of locking used to support concurrency. If a locktype is not supported, it is changed at run-time. rdConcurRowVer locktype is only supported on a data source that has a primary key and a timestamp.



RESOLUTION
If you want to use rdConcurRowVer for a server-side cursor, the table must have a primary key and a timestamp.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Create a standard exe in Visual Basic. Form1 is created by default. Under Project References, select Microsoft Remote Date Object 2.0.  Place two CommandButtons on the form and paste the following code in the form.

Note You must change UID and PWD to the correct values before you run this code. Make sure that UID has the appropriate permissions to perform this operation on the database. Option Explicit Dim en As rdoEnvironment Dim rs As rdoResultset Dim cn As rdoConnection Dim sqlstr As String

Private Sub Command1_Click sqlstr = "select * from tablename" Set rs = cn.OpenResultset(sqlstr, rdOpenKeyset, _             rdConcurRowVer) End Sub

Private Sub Command2_Click If Not (rs Is Nothing) Then rs.Close End If         cn.Close Unload Me      End Sub

Private Sub Form_Load Set en = rdoEnvironments(0) en.CursorDriver = rdUseServer Set cn = en.OpenConnection(dsName:="datasourcename", _          Prompt:=rdDriverNoPrompt, _           Connect:="uid= ;pwd= ;database=PUBS;") Command1.Caption = "resultset" Command2.Caption = "quit" End Sub  Replace the datasourcename and the table name above. The table name should be changed to different tables, such as primary key and timestamp, to try out the various combinations (just primary key, just timestamp, just id, id and timestamp, and none of the above). Run the form and execute the resultset click button. Pause the execution.</li> Select "add watch" from the debug window. Create a watch for rs.</li> When the watch window appears, click the plus sign (+) and look at locktype. Note that the only time locktype shows rdConcurRowVer is when the table has a timestamp and a primary key.</li></ol>

<div class="references_section">