Microsoft KB Archive/189853

= PRB: Data Environment: Error Setting Lock Type =

Article ID: 189853

Article Last Modified on 8/23/2001

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft ActiveX Data Objects 2.1
 * Microsoft ActiveX Data Objects 2.1 Service Pack 2
 * Microsoft ActiveX Data Objects 2.5
 * Microsoft ActiveX Data Objects 2.6
 * Microsoft ActiveX Data Objects 2.7

-



This article was previously published under Q189853



SYMPTOMS
When trying to use Pessimistic locking and Client Cursors, Visual Basic generates the following error message:

An invalid value was entered for 'Lock Type'.

Under Microsoft Data Access Components (MDAC) version 2.5, the error message appears as

Invalid property value.



CAUSE
Pessimistic locking is not available with Client cursors in ADO or the Data Environment.



RESOLUTION
Change your cursor to Server-Side or change your lock type.



STATUS
This behavior is by design.



MORE INFORMATION
Note that Pessimistic locking on server-side cursors must be supported by the driver/provider in order to use this functionality in ADO. SQL Server and Access drivers and providers have this functionality whereas Oracle does not.

Under MDAC version 2.5 or later, you cannot set the locktype to Pessimistic when the cursor location is set to aduseclient. The above error will be returned immediately.

Steps to Reproduce Behavior
 Run Visual Basic 6.0 and open a new Standard EXE Project. Form1 is created by default. Add a DataEnvironment to the project. In the Data Environment Window, right-click the default Connection1 object, choose Properties from the shortcut menu, choose the Connection tab, and then select the Use Connection String option.  Enter your Connection String to a valid data source. This example will use SQL Server's pubs database and the authors table, such as: CONNECTIONSOURCE="PROVIDER=sqloledb;DATA" & _ "SOURCE=;" & _ "INITIAL CATALOG=pubs;" & _ "USER ID= ;PASSWORD= ;"

 Click OK. Click the Add a Command object to open a table.</li> Set the Command Name to Authors.</li> Change the Database Object to Table.</li> From the list of tables, select Authors.</li> Change the locktype to Pessimistic. The location is aduseclient by default.</li></ol>

Result:

Microsoft Data Environment Designer

An invalid value was entered for 'Lock Type'

Keywords: kbdatabinding kbdatabase kbprb KB189853

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.