Condividi tramite


VALIDATE DATABASE Command

Ensures that the locations of tables and indexes in the current database are correct.

VALIDATE DATABASE [RECOVER] [NOCONSOLE]
   [TO PRINTER [PROMPT] | TO FILE FileName]

Parameters

  • RECOVER
    Displays dialogs that make it possible for you to locate tables and indexes that are not in the locations contained in the database. Beginning with Visual FoxPro 7, the RECOVER clause is supported in programs.

  • NOCONSOLE
    Suppresses error message output to the main Visual FoxPro window or to the active user-defined window.

  • TO PRINTER [PROMPT]
    Directs error message output from VALIDATE DATABASE to a printer.

    PROMPT displays a Print dialog box before printing starts. Place the PROMPT keyword immediately after TO PRINTER.

  • TO FILE FileName
    Directs error message output to the file specified with FileName. If the file already exists and SET SAFETY is ON, you are asked if you want to overwrite the file.

Remarks

VALIDATE DATABASE ensures that the database contains the proper locations of tables and indexes, that tables in the database contain the proper fields, and that index tags in the database exist.

VALIDATE DATABASE operates on the current database. The database must be opened for exclusive use by including the EXCLUSIVE keyword when you issue OPEN DATABASE.

Example

The following example opens the testdata database and uses VALIDATE DATABASE to ensure that the locations of tables and indexes in the database are correct.

CLOSE DATABASES
SET PATH TO (HOME(2) + 'Data\') && Sets path to database
OPEN DATABASE testdata EXCLUSIVE && Open testdata database

VALIDATE DATABASE

See Also

CREATE DATABASE | MODIFY DATABASE | OPEN DATABASE | USE