Knowledge Base

FIX: Table Allows Modification Although DBC is Opened NOUPDATE

Article ID: 192977

Article Last Modified on 5/12/2003


APPLIES TO


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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. 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
    							
  2. When the Table Designer displays, create an index on the Cfield field and then click the OK button.
  3. Click Yes in the confirmation dialog to make the changes permanent.
  4. 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.

REFERENCES


Additional query words: kbVFp300bbug kbVFp500abug kbVFp600fix KbDBFDBC kbDatabase kbXBase

Keywords: kbbug kbfix KB192977