table的recordcount |
缺席
|
cyl
中階會員 ![]() ![]() ![]() 發表:163 回覆:171 積分:66 註冊:2002-07-11 發送簡訊給我 |
|
pgdennis
資深會員 ![]() ![]() ![]() ![]() ![]() 發表:41 回覆:526 積分:443 註冊:2002-05-23 發送簡訊給我 |
|
cyl
中階會員 ![]() ![]() ![]() 發表:163 回覆:171 積分:66 註冊:2002-07-11 發送簡訊給我 |
|
wnhoo
高階會員 ![]() ![]() ![]() ![]() 發表:75 回覆:443 積分:198 註冊:2003-04-22 發送簡訊給我 |
你可以这样试验一下。在你每次操作后: 方法一
table1.UpdateMode :=upWhereAll;
table1.Refresh ;
showmessage(inttostr(table1.RecordCount)); 方法二
table1.Active :=false;
table1.Active :=true;
showmessage(inttostr(table1.RecordCount)); 小弟浅见,供参考!!! 风花雪月 e梦情缘
------
风花雪月 e梦情缘 |
tech_state
版主 ![]() ![]() ![]() ![]() ![]() ![]() 發表:44 回覆:638 積分:641 註冊:2003-02-10 發送簡訊給我 |
引言:引言: 可是我用Ttable,TQuery都正常,我是連oracle... table1.Filtered:=true; table1.Filter:='ACOD=' QuotedStr('A'); showmessage(inttostr(table1.RecordCount));cyl, 您好 由help檔得知 CachedUpdates enables or disables the use of cached updates for a dataset. If CachedUpdates is true, cached updates are enabled. If CachedUpdates is false, cached updates are disabled. When cached updates are enabled, updates to a dataset (such as posting changes, inserting new records, or deleting records), are stored in an internal cache on the client machine instead of being written directly to the dataset's underlying database tables. When changes are complete, an application writes all cached changes to the database in the context of a single transaction. 意思是說只要設定cachedupdate=true 所有資料庫變更都會先存在client machine 除非將變更update到database 才會查詢到新的資料 因此才會Show出來的table.recordcount 就都不對 如同wnhoo提出的方法, 如果是用TDBGrid來顯示的話, 確實可以看到過濾後的資料, 但是實際的table.recordcount 仍舊是不變的, 還是過濾前的table.recordcount。 以上想法,若有錯誤請指正。 ======================= 是非終日有,不聽自然無 天下本無事,庸人自擾之 |
pgdennis
資深會員 ![]() ![]() ![]() ![]() ![]() 發表:41 回覆:526 積分:443 註冊:2002-05-23 發送簡訊給我 |
引言:引言: 可是我用Ttable,TQuery都正常,我是連oracle... table1.Filtered:=true; table1.Filter:='ACOD=' QuotedStr('A'); showmessage(inttostr(table1.RecordCount));我想你是不是不想要重新query的情形下,用filter的方法過濾資料,,,, 而你又需要CACHEDUPDATE=TRUE...我想你是不是在filter時先將CACHEDUPDATE=false..反正這時你是查詢資料,沒有修改資料...如
------
星期一,二...無窮迴圈@@ |
wnhoo
高階會員 ![]() ![]() ![]() ![]() 發表:75 回覆:443 積分:198 註冊:2003-04-22 發送簡訊給我 |
.....//~~~~~~~~~
table1.Active :=true;
table1.CachedUpdates :=false;
.....//相关数据操作
table1.Refresh;
table1.CachedUpdates :=true;
{可选}
//table1.Active :=false
//table1.Active :=true;
showmessage(inttostr(table1.RecordCount)); 风花雪月 e梦情缘
------
风花雪月 e梦情缘 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |