VB Application Incorrectly Indicates Lost Data Record (120515)



The information in this article applies to:

  • Microsoft Windows NT Server 3.1
  • Microsoft Windows NT Workstation 3.1

This article was previously published under Q120515

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.

Modification Type:MajorLast Reviewed:11/4/2003
Keywords:KB120515