ADOTable/Refresh与Requery |
答題得分者是:max5020
|
leonli80
一般會員 發表:29 回覆:27 積分:11 註冊:2006-08-01 發送簡訊給我 |
|
yubad2000
中階會員 發表:0 回覆:44 積分:78 註冊:2007-09-30 發送簡訊給我 |
procedure Refresh;
C syntax: void __fastcall Refresh(void); Description Call Refresh to ensure that an application has the latest data from a database. For example, when an application turns off filtering for a dataset, it should immediately call Refresh to display all records in the dataset, not just those that used to meet the filter condition. Note: The Refresh method does not work for all TDataSet descendants. In particular, TQuery components do not support the Refresh method if the query is not ive? To refresh a static TQuery, close and reopen the dataset. TDataSet generates a BeforeRefresh event before refreshing the records and an AfterRefresh event afterwards. Note: Most datasets try to maintain the current record position when you call refresh. However, this is not always possible. For example, the current record may have been deleted from the server by another user. Unidirectional datasets have no mechanism for locating the current record after a refresh, and always move back to the first record. Warning: Unidirectional datasets refresh the data by closing and reopening the cursor. This can have unintended side effects if, for example, you have code in the BeforeClose, AfterClose, BeforeOpen, or AfterOpen event handlers. procedure Requery(Options: TExecuteOptions = []); C syntax: void __fastcall Requery(TExecuteOptions Options = TExecuteOptions()); Description Call Requery to refresh the recordset. Requery updates the dataset by re-executing the original command or SQL statement that produced the recordset. The effects of Requery are the same as calling the dataset Close method and then its Open method. However, there are circumstances when one means of refreshing the recordset is better than the other. The values in properties like CursorLocation, CursorType, and LockType cannot be changed while the dataset is open, so Requery can only refresh the recordset using the existing values in these properties. To refresh the recordset using different values for these properties, effect the refresh using the Close and Open methods. Options is a TExecuteOptions value that specifies the characteristics of the command execution affected by the requery that produces the recordset for the dataset. ===================引 用 leonli80 文 章=================== 請問各位Refresh与Requery 兩者在使用中的區別。
------
===波士頓夜未眠=== What a wonderful world!! Jazz up the world with jazz!! ================== When I am not programming... you can find me here: http://www.holy-war.de/EN/World3/bin/?advertiser=63190 |
max5020
資深會員 發表:30 回覆:277 積分:321 註冊:2003-06-04 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |