Microsoft KB Archive/192977

= FIX: Table Allows Modification Although DBC is Opened NOUPDATE =

Article ID: 192977

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q192977



SYMPTOMS
If you open a database in Visual FoxPro with the NOUPDATE option of the OPEN DATABASE command, and then you modify the structure of a table contained in that database, you can save changes to the table structure. This can cause the database to become invalid.



RESOLUTION
In the versions of Visual FoxPro previous to 6.0, do not modify a table structure if the OPEN DATABASE command uses the NOUPDATE argument.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Visual FoxPro 6.0.



Steps to Reproduce Behavior
  Run the following code from a program (.PRG) file: CLEAR CLOSE DATABASE ALL SET SAFETY OFF CREATE DATABASE 'TESTDB.DBC' CREATE TABLE 'TESTTAB.DBF' NAME 'TESTTAB' (CFIELD C(3) NOT NULL) CLOSE DATABASE ALL OPEN DATABASE testdb NOUPDATE USE testtab EXCLUSIVE MODIFY STRUCTURE VALIDATE DATABASE  When the Table Designer displays, create an index on the Cfield field and then click the OK button. Click Yes in the confirmation dialog to make the changes permanent. Click OK in the "Cannot update cursor" error dialog box.

NOTE: The VALIDATE DATABASE command yields an error that the newly created index is missing from the database container.

