Repopulate data in an ABL data source bound to a ProBindingSource
- Last Updated: June 19, 2019
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
If an application needs to repopulate the data in the underlying ABL data source that is bound to a ProBindingSource, you can accomplish this in several different ways. For example:
- You can execute new
QUERY-PREPARE( )andQUERY-OPEN( )methods on the query that the ProBindingSource is bound to.Because the ProBindingSource is directly bound to the query that was just reopened, you do not have to do anything further as long as the ProBindingSource's
AutoSyncproperty is set to TRUE (which is the default). If the property is set to FALSE, simply callmyBindingSource:RefreshAll( )to notify the control to refresh. - You can empty and repopulate a temp-table by executing a new
query on the database and then creating appropriate temp-table records.
If you choose this option, you must reopen the query the ProBindingSource is bound to (that is, the query on the temp-table). This is important: Even though the query criteria has not changed (it is still for each temp-table record), the ProBindingSource must be working from the right query result set in order for the control to show the correct records. In particular, having the correct count of records in the result set is critical.
Reopening the query takes care of this, and you must call
myBindingSource:RefreshAll( )to notify the control to refresh.
To empty a control
bound to a ProBindingSource, the application must modify the query,
so that no records satisfy it, and then reopen it. (Neither closing
the query nor setting the Handle property to the Unknown value (?) is
sufficient.)
For example, here is a typical query that would empty the result set:
|
Here is another way to repopulate the data; however, this approach is highly inefficient and not recommended: