Reset method (DataWindows)
Description
Clears all the data from a DataWindow
control or DataStore object.
For the syntax to use for deleting graphs
within a DataWindow object that have an external data source, see Reset. For the syntax
to use with other PowerBuilder controls, see Reset in
the PowerScript Reference.
Controls
|
DataWindow type |
Method applies to |
|---|---|
|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
|
Web |
Server component |
|
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
|
1 |
integer <span>dwcontrol</span>.<span>Reset</span> ( ) |
[Web DataWindow server component]
|
1 |
short <span>dwcontrol</span>.<span>Reset</span> ( ) |
[Web ActiveX]
|
1 |
number <span>dwcontrol</span>.<span>Reset</span> ( ) |
|
Argument |
Description |
|---|---|
|
dwcontrol |
A reference to a DataWindow control, |
Return Values
Returns 1 if it succeeds and –1 if an error occurs.
The return value is usually not used.
If dwcontrol is null, in PowerBuilder
and JavaScript the method returns null.
Usage
Reset is not the same as deleting rows
from the DataWindow object or child DataWindow. Reset affects
the application only, not the database. If you delete rows and then
call the Update method, the rows are deleted
from the database table associated with the DataWindow object. If
you call Reset and then call Update,
no changes are made to the table.
PowerBuilder environment
If you call Reset when the Retrieve As
Needed option is set, Reset will clear the rows
that have been retrieved. However, because Retrieve As Needed is
on, the DataWindow immediately retrieves the next set of rows.
To prevent the rows from being retrieved, call DBCancel before
calling Reset. If all the rows have been retrieved
(the cursor has been closed and the RetrieveEnd event has occurred),
then when Reset clears the DataWindow, it stays
empty.
Examples
This statement completely clears the contents of
dw_employee:
|
1 |
dw_employee.<span>Reset</span>() |
In a DataWindow whose Retrieve As Needed option is
on, this example cancels the retrieval before resetting the DataWindow:
|
1 |
dw_employee.<span>DBCancel</span>() |
|
1 |
dw_employee.<span>Reset</span>() |