DOCUMENT:Q189853 13-AUG-1998 [vbwin] TITLE :PRB: Data Environment: Error Setting Lock Type PRODUCT :Microsoft Visual Basic for Windows PROD/VER: OPER/SYS:WINDOWS KEYWORDS: ====================================================================== --------------------------------------------------------------------- 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. 3. 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. 4. 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=;" 5. Click OK. 6. Click on the Add a Command button to open a table. 7. Set the Command Name to "Authors." 8. Change the Database Object to "Table." 9. 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 ====================================================================== Platform : WINDOWS Issue type : kbprb ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.