Microsoft KB Archive/130462

= INFO: Difference Between REQUERY and REFRESH in Visual FoxPro =

Article ID: 130462

Article Last Modified on 11/17/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q130462



SUMMARY
This article lists the differences in functionality between two new functions - REQUERY and REFRESH - in Visual FoxPro.



REQUERY

 * Retrieves data again for a SQL view.
 * Throws out the current cursor and starts over, possibly with new parameters.
 * Pulls in all rows.
 * Returns 1 if data is successfully retrieved; otherwise, it returns 0.
 * Is typically used to refresh a SQL view when data has changed on the data source.

REFRESH

 * Refreshes data in an updatable SQL view. It goes back to the server and gets new values for any rows that you haven't edited in a buffered view. (It also caches an image of the rows you have been editing, but it doesn't force these values over the top of your changes.)
 * Is helpful for checking to see whether other users have changed data while you've been buffering.
 * Takes an optional parameter to specify what rows to update, so you can grab just the ones that are currently on the user's screen, for example.
 * Is a necessary precursor to issuing CURVAL for remote data.
 * Returns the number of records refreshed. The records are refreshed with data from the tables from which the SQL view is created. Records are refreshed in the SQL view open in the currently selected work area.
 * Cannot refresh locked or buffered records, and the records refreshed must have unique primary keys. If a record in a table does not have a primary key value, the corresponding record in the SQL view is marked for deletion.

