PRB: SET INDEX TO Command Causes Error When Run from a Form
Article ID: 140565
Article Last Modified on 9/30/2003
APPLIES TO
- Microsoft Visual FoxPro 3.0 Standard Edition
- Microsoft Visual FoxPro 3.0b Standard Edition
This article was previously published under Q140565
SYMPTOMS
One of the following errors occurs occur when attempting to run the SET
INDEX TO command programmatically from a running form:
- File must be opened exclusively.
-or-
- File is in use by another.
CAUSE
A table opened by the Data Environment of a form is opened shared by
default. Therefore, when the form is running and you issue an INDEX ON
command, an error occurs.
RESOLUTION
Set the Exclusive Property of the cursor to .T. at design time.
NOTE: Attempting to set this property at run-time causes the following
error message:
Property setting will not take effect until data environment reloaded
STATUS
This behavior is by design.
Additional query words: VFoxWin
Keywords: kberrmsg KB140565