Condividi tramite


RefreshCmd Property

Specifies the command to use for the record Refresh performed by the RecordRefresh method. Read/write at design time and run time.

CursorAdapter.RefreshCmd[ = cCommand]

Parameters

  • cCommand
    Character data type. The following table lists the possible values for cCommand.

    cCommand Description

    Character string or expression

    Specifies a valid command string for the data source specified by the RefreshCmdDataSourceType Property and RefreshCmdDataSource Property properties.

    For ADO and ODBC data sources, you can specify any command that is supported by the data source and returns exactly one record.

    For a native Visual FoxPro data source, the command should be a SQL SELECT command that returns exactly one record. Fields are matched by their position in the cursor excluding fields specified in the RefreshIgnoreFieldList property.

    Empty string ("")

    The CursorAdapter object automatically generates a record Refresh command.

    The generated command is based on the data source and the CursorAdapter Tables, KeyFieldList, UpdateNameList and RefreshIgnoreFieldList properties. If you include a command, the Tables, KeyFieldList, and UpdateNameList properties are ignored.

    Note

    A command that is automatically generated does not include AUTOINC or key fields, even if they are not included in the RefreshIgnoreFieldList property.

Remarks

Applies To: CursorAdapter Class

The command you specify is executed for every target record. Validation rules for target fields are not executed.

No fields are refreshed if an error occurs during the record refresh. An error is generated if data conversion from a source field to the target field is not supported. Attempting to refresh an AUTOINC field will generate an error. The refresh operation is cancelled if an attempt to update indexes fails due to non-unique key or for any other reason.

For ADODB Recordsets, the CursorAdapter RefreshCmd, Tables, KeyFieldList, and UpdateNameList properties are ignored, and no error is generated if key fields are not specified.

If the lock type for the ADODB Recordset is not adLockBatchOptimistic or adLockUnspecified, the CursorAdapter calls the Resync Method with the ResyncValues parameter set to adResyncAllValues to refresh the record in the Recordset before the record in the cursor is refreshed.

You can set this property in the BeforeRecordRefresh Event.

See Also

Reference

BeforeRecordRefresh Event
KeyFieldList Property
RefreshIgnoreFieldList Property
RefreshCmdDataSource Property
RecordRefresh Method
Tables Property
UpdateNameList Property