Microsoft KB Archive/95746

{|
 * width="100%"|

-

The information in this article applies to:


 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a
 * Microsoft FoxPro for Windows, versions 2.5, 2.5a

-

SUMMARY
FoxPro automatically locks the record in the currently selected database as well as any related records in other work areas that are involved in a READ command. You can bypass the automatic record locking by using the READ NOLOCK command. Using this command may result in improved network performance when you are skipping through a database file.

MORE INFORMATION
Issuing a READ NOLOCK command bypasses automatic record locking. The record is displayed and the GET fields are enabled, but are read-only. Any controls, such as buttons, that use a field are disabled and cannot be chosen.

The record cannot be edited until SHOW GETS LOCK, LOCK, or RLOCK is issued. The record cannot be locked by using the shortcut key combination CTRL+O.

Issuing SHOW GETS without the LOCK clause will not allow the record to be locked, because SHOW GETS assumes the locking behavior of the READ command itself. Since the READ command has the NOLOCK clause, SHOW GETS will not lock the record.

SHOW GETS LOCK, LOCK, and RLOCK all attempt to lock the record in the current work area. SHOW GETS LOCK attempts to lock related records in other work areas as well. LOCK and RLOCK do not attempt to lock related records. If the record is locked by another user, FoxPro will return error 109.

If SET MULTILOCKS is OFF, the record lock will automatically be released when the record pointer is moved off the current record. If SET MULTILOCKS is ON, the record lock will not be released until the database is closed, the user exits FoxPro, or an UNLOCK command is issued.

To enable READ NOLOCK, SET EXCLUSIVE must be OFF.

To issue a READ NOLOCK command for a screen created through the FoxPro screen generator, check the READ NOLOCK check box in the generator options dialog box.