RowsAffected Method

The RowsAffected method returns the number of records, affected by the last operation.

Applies to objects: Recordset.

Syntax

[[Let] RetVal = ] object.RowsAffected()

The RowsAffected method syntax has these parts:

Part Description
object Required. A reference to an instance of the object.
RetVal Optional. A Long type variable, that gets the number of records.

Remarks

The RowsAffected method returns the number of records, affected by the AddNew, Delete and Update methods.

In some cases it's not possible to determine the number of records in the resulting multitude. The majority of data sources don't let determine the size of the resulting multitude when performing the SELECT operation, but determine the size successfully after UPDATE, DELETE, INSERT.

If the number of strings is unknown, the method returns -1.

Example

.......

 

See Also

Recordset Object, GetRows Method.