PRB: Data Environment: Error Setting Lock Type

ID: Q189853


The information in this article applies to:
  • Microsoft Visual Basic Enterprise Edition for Windows, version 6.0


SYMPTOMS

When trying to use Pessimistic locking and Client Cursors, Visual Basic generates an error saying "An invalid value was entered for 'Lock Type'."


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.

Steps to Reproduce Behavior

  1. Run Visual Basic 6.0 and open a new Standard EXE Project. Form1 is created by default. Add a DataEnvironment to the project.


  2. In the Data Environment Window, right-click on default Connection1 object, choose "Properties" from the shortcut menu, choose the "Connection" tab, and then select "Use Connection String" option.


  3. 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=<server_name>;" & _
                           "INITIAL CATALOG=pubs;" & _
                           "USER ID=<uid>;PASSWORD=<pwd>;"
     


  4. Click OK.


  5. Click on the Add a Command button to open a table.


  6. Set the Command Name to "Authors."


  7. Change the Database Object to "Table."


  8. Select a table from the list "Authors."


Result:
Microsoft Data Environment Designer
An invalid value was entered for 'Lock Type'

Additional query words: kbDSupport kbdse kbDSupport kbVBp kbvbp600 KbADO kbDatabase kbDataBinding

Keywords : kbGrpVBDB
Version :
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: January 5, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.