ModifiedCount

Description

Reports the number of rows that have been modified but not updated in a DataWindow or DataStore.

Applies to

DataWindow type

Method applies to

PowerBuilder

DataWindow control, DataWindowChild object, DataStore object

Web

Client contol, server component

Web ActiveX

DataWindow control, DataWindowChild object

Syntax

PowerBuilder and Web DataWindow server component

long dwcontrol.ModifiedCount ( ) 

Web DataWindow client control and Web ActiveX

number dwcontrol.ModifiedCount ( ) 

Argument

Description

dwcontrol

A reference to a DataWindow control, DataStore, or child DataWindow

Returns

Returns the number of rows that have been modified in the primary buffer. Returns 0 if no rows have been modified or if all modified rows have been updated in the database table. Returns –1 if an error occurs.

If dwcontrol is null, in PowerBuilder and JavaScript the method returns null.

Usage

ModifiedCount reports the number of rows that are scheduled to be added or updated in the database table associated with a DataWindow or DataStore. This includes rows in the primary and filter buffers.

A newly inserted row (with a status flag of New!) is not included in the modified count until data is entered in the row (its status flag becomes NewModified!).

The DeletedCount method counts the number of rows in the deleted buffer. The RowCount method counts the total number of rows in the primary buffer.

Examples

Example 1

If five rows in dw_Employee have been modified but not updated in the associated database table or filtered out of the primary buffer, the following code sets ll_Rows equal to 5:

long ll_Rows

ll_Rows = dw_Employee.ModifiedCount()

Example 2

If any rows in dw_Employee have been modified but not updated in the associated database table, this statement updates the database table associated with the dw_employee DataWindow control:

IF dw_employee.ModifiedCount() > 0 THEN &

		dw_employee.Update()

See also