VB Application Incorrectly Indicates Lost Data Record

Last reviewed: January 31, 1995
Article ID: Q120515
The information in this article applies to:
  • Microsoft Windows NT operating system version 3.1
  • Microsoft Windows NT Advanced Server version 3.1

SYMPTOMS

When Visual Basic applications do not include proper error handling when performing database record processing, the applications may report null records and the following error message appears:

   Error #70:  ....File Locked.

In this case, Windows for Workgroups workstations that are reading records to a database stored on a Windows NT Advanced Server system may incorrectly report lost records. Record write failures may also lose records in a similar way.

CAUSE

Although the server reports a locking violation to the workstation, the application does not handle the error. Null record values are returned during a read failure. Data being written may appear to be lost if the write fails to complete. Protocol analysis will show that the Windows NT Advanced Server system returns a server message block (SMB) locking violation.

RESOLUTION

If the application receives a locking violation, the application must handle this error by backing off and waiting for a period of time. This period of time must be determined to be reasonable based on a normal period that a user will require exclusive access to a data record. After waiting, the application can then attempt to retry the operation. The application backs off and retries the operation until it is successful, or it returns an appropriate error message to the user indicating that the record is not accessible at this time. Proper error handling is critical to guaranteeing successful data record reading and writing.


Additional reference words: wfw wfwg prodnt 3.10
KBCategory: kbintrop kberrmsg
KBSubcategory: nt16ap


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.

Last reviewed: January 31, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.