Delphi .NET (2) Database (71) Delphi IDE (89) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280)
Exchange Links About this site Links to us 
|
Update controls bound to a query without a primary index
This article has not been rated yet. After reading, feel free to leave comments and rate it.
If a query has a primary index, you may just code "Query1.Refresh"
to update a form. This fails if the query has no primary index.
The following procedure shows a flicker-reduced solution:
 | |  | |
procedure UpdateQuery(aQuery : TQuery);
var
aBookmark : TBookmark;
begin
aQuery.DisableControls;
aBookmark := aQuery.GetBookmark;
aQuery.Close;
aQuery.Open;
aQuery.GotoBookmark (aBookmark);
aQuery.FreeBookmark (aBookmark);
aQuery.EnableControls;
end;
| |  | |  |
Comments:
|