Partilhar via


ConflictCheckType Property

Specifies how to handle conflict checking during an update or delete operation using commands specified by the CursorAdapter UpdateCmd and DeleteCmd properties. Read-write at design time and run time.

You can use ConflictCheckType with native, Open Database Connectivity (ODBC), and ActiveX Object (ADO) data sources. When using ADO, the CursorAdapter object should use an ADO Command object for the SQL UPDATE or DELETE operation. Otherwise, Visual FoxPro disregards ConflictCheckType.

CursorAdapter.ConflictCheckType [= nValue]

Return Value

  • nValue
    Specifies a number that determines how to handle conflict checking.

    The following table lists the values for nValue.

    nValue Description

    0

    Do not perform checks. (Default)

    1

    In single row update mode, check for update conflicts during a SQL UPDATE or DELETE operation. If conflict occurs, specifically, no record is affected by any command specified by the UpdateCmd or DeleteCmd property, return message "Update conflict (Error 1585)".

    2

    In single row update mode, check for key uniqueness during a SQL UPDATE or DELETE operation. If more than one record is affected by any command specified by the UpdateCmd or DeleteCmd property, return message "Warning: The key defined by the KeyField property for table "alias" is not unique. (Error 1495)"

    3

    Perform checks as specified by settings 1 and 2.

    4

    Append custom command specified in ConflictCheckCmd property to the end of the command in the UpdateCmd and DeleteCmd properties.

    Note

    Due to ODBC and ADO limitations, settings 1, 2, and 3 might not work correctly if the UpdateCmd and DeleteCmd properties contain more than one command. It is possible that the number of affected rows is not returned for every command in a batch. Therefore, it is recommended that you set ConflictCheckType to 4 and specify a custom command in the ConflictCheckCmd property or make sure that only one SQL UPDATE or DELETE command will be executed. Also, Visual FoxPro disregards settings 1, 2, and 3 when performing a batched TABLEUPDATE operation.

Remarks

Applies To: CursorAdapter Class

See Also

Reference

ConflictCheckCmd Property
UpdateCmd Property
DeleteCmd Property
CursorAdapter Object Properties, Methods, and Events
UPDATE - SQL Command
DELETE - SQL Command
TABLEUPDATE( ) Function

Other Resources

Properties (Visual FoxPro)