Condividi tramite


SET TABLEVALIDATE Command

Specifies the level of table validation to perform. Use SET TABLEVALIDATE when you want a lower level of table integrity checking than the default setting.

SET TABLEVALIDATE TO [nLevel]

Parameters

  • nLevel
    Specifies the level of table validation as the sum of the bit values.

    Note

    The default setting for nLevel is 3.

    The following table describes the bits and bit values that you can add to obtain a setting for nLevel.

    Bit number

    Bit value (additive)

    Description

    0

    0

    Do not perform table validation.

    0

    1

    Validate record count when opening a table.

    Note

    The table (.dbf) header is locked during validation. This operation can result in decreased scalability when tables open as shared, for example, when issuing the USE command with the SHARED keyword or calling the SQL SELECT, UPDATE, INSERT, or DELETE commands against a closed table, and SET EXCLUSIVE is set to OFF.

    1

    2

    Validate record count when appending or inserting records and writing them to disk.

    2

    4

    Suppress "File is in use (Error 3)" if table header cannot be locked when opening the table. Requires setting the first bit to validate record count when opening a table.

    > [!NOTE]
    > <P>When opening a table, the USE command attempts to lock the table header only once. If the header is locked, Visual FoxPro performs a strict header check, similar to SET TABLEVALIDATE set to 1. Otherwise, Visual FoxPro suppresses the "File is in use" error and performs a header check in the manner of versions prior to Visual FoxPro 8.0.</P>
    

    3

    8

    Check .dbf header before saving append operation to disk and modifying header.

    Remarks

    SET TABLEVALIDATE does not have repair functionality; it performs only integrity checks as specified by nLevel.

    SET TABLEVALIDATE does not perform table validation on temporary files or cursors.

    You can set SET TABLEVALIDATE in Config.fpw as follows:

    TABLEVALIDATE = nLevel
    

    If a table opens exclusively, and SET TABLEVALIDATE is set to 8 or greater, the setting is disregarded.

    See Also

    Reference

    SET Command Overview

    USE Command

    SELECT - SQL Command

    INSERT - SQL Command

    UPDATE - SQL Command

    DELETE - SQL Command

    Other Resources

    Programming for Shared Access

    Commands (Visual FoxPro)