Главная страница | назад





Article #23011: Using the requery method in place of the refresh method.

QUESTION:

How can I speed up ADO's slow refresh for my table?

ANSWER:

Use the requery method, this will update your tables faster. Call requery to refresh the recordset by re-executing the original command or SQL statement that produced the record set. Here is an example on how to implement requery:

procedure TFrmListOpen.TableRefresh;
var
SavePlace : TBookmark;
begin
{Using a standard refresh takes too long. This code will perform a }
{refresh much quicker.}
SavePlace := DM.TableOpenEvents.GetBookmark;
DM.TableOpenEvents.Requery;
DM.TableOpenEvents.GotoBookMark(SavePlace);
DM.TableOpenEvents.FreeBookMark(SavePlace);
end;

Last Modified: 08-SEP-00