BatchUpdateCount Property

Specifies the number of update statements sent to the remote data source for buffered tables. When working with this property for regular cursors, use the CURSORSETPROP() and CURSORGETPROP() functions. Read/write.

Adjusting BatchUpdateCount can increase automatic updating performance dramatically.

Note   Setting BatchUpdateCount for a CursorAdapter object overrides the property setting of a cursor when attached to a CursorAdapter object. That is, changing the settings on the cursor using CURSORSETPROP() has no effect.

CursorAdapter.BatchUpdateCount [ = nValue]

Property Values

  • nValue
    Numeric data type. The nValue parameter has a default value of 1.

Remarks

BatchUpdateCount applies for CursorAdapter objects only when the data source type for the SQL INSERT, UPDATE, and DELETE commands is one of the following:

  • "ODBC"

    Additionally, the same connection handle must be used as the data source for the SQL INSERT, UPDATE, and DELETE commands.

    Note   The data source and data source type might be inherited from the DataSource and DataSourceType properties of either the CursorAdapter or DataEnvironment object.

  • "ADO"

    The same ADODB Command object must be used as the data source for the SQL INSERT, UPDATE, and DELETE commands. It is recommended that you set the InsertCmdDataSource, InsertCmdDataSourceType, UpdateCmdDataSource, UpdateCmdDataSourceType, DeleteCmdDataSource, and DeleteCmdDataSourceType properties explicitly because inheritance does not work in this scenario.

  • "XML"

    It is recommended that you set the InsertCmdDataSource, InsertCmdDataSourceType, UpdateCmdDataSource, UpdateCmdDataSourceType, DeleteCmdDataSource, and DeleteCmdDataSourceType properties explicitly because inheritance does not work in this scenario.

If BatchUpdateCount is greater than 1, Visual FoxPro updates the batch by executing the UpdateCmd property once per batch.

Note   If batch updating is used, the BeforeInsert, AfterInsert, BeforeUpdate, AfterUpdate, BeforeDelete, and AfterDelete events do not fire. If an update fails for a batch, Visual FoxPro attempts to send a separate update for each row in the batch; however, the events still do not fire.

See Also

Properties | CursorAdapter Object Properties, Methods, and Events | CURSORGETPROP( ) Function | CURSORSETPROP( ) Function | INSERT - SQL Command | UPDATE - SQL Command | DELETE - SQL Command | DataSource Property | DataSourceType Property | InsertCmdDataSource Property | InsertCmdDataSourceType Property | UpdateCmdDataSource Property | UpdateCmdDataSourceType Property | DeleteCmdDataSource Property | DeleteCmdDataSourceType Property | UpdateCmd Property | BeforeInsert Event | AfterInsert Event | BeforeUpdate Event | AfterUpdate Event | BeforeDelete Event | AfterDelete Event

Applies To: CursorAdapter Class