Advanced PowerBuilder

HomePrevious Lesson: DataWindow Events
Next Lesson: RetrieveRow Event

RetrieveStart Event

This event triggers as soon as PowerBuilder gets notification from the database saying "I processed your query and this is the result set you are waiting for". Upon successful execution of this event�s code, PowerBuilder starts retrieving the result set.

This event has no parameters and returns zero by default meaning �continue processing�. For any reason if you do not want to retrieve the result set, then return 1 from this event.

By default, each time you call Retrieve() function, PowerBuilder clears all the existing data in the DataWindow, i.e., previously retrieved data, any changes you have done to the retrieved data, and new rows you inserted after previous Retrieve()and populates the DataWindow with the results of Retrieve() function. For any reason, if you want to keep the existing data in the DataWindow and want to append the new result set, just return 2 from this event.

The following code displays a message on the status bar, just before PowerBuilder starts retrieving the data. To understand the behavior of return value, you may want to append RETURN statement with different return values as explained earlier to the following code and execute it.


// Object: DataWindow dw_query in w_product_master window
// Event: RetrieveStart
w_mdi_frame.SetMicroHelp( "Starting to Retrieve Rows�" )
HomePrevious Lesson: DataWindow Events
Next Lesson: RetrieveRow Event