ReselectRow  ResetTransObject

Chapter 9: Methods for the DataWindow Control

Reset

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 PocketBuilder controls, see Reset in the PowerScript Reference.

Syntax

integer dwcontrol.Reset ( ) 

Argument

Description

dwcontrol

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

Returns

Returns 1 if it succeeds and -1 if an error occurs. The return value is usually not used. If dwcontrol is NULL, 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.

NotePreventing rows from being retrieved after calling Reset 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

Example 1

This statement completely clears the contents of dw_employee:

dw_employee.Reset()

Example 2

In a DataWindow whose Retrieve As Needed option is on, this example cancels the retrieval before resetting the DataWindow:

dw_employee.DBCancel()

dw_employee.Reset()

See also





Copyright © 2004. Sybase Inc. All rights reserved. ResetTransObject

View this book as PDF