線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1316
推到 Plurk!
推到 Facebook!

how to get the updated value paradox table ?

答題得分者是:P.D.
homing
一般會員


發表:4
回覆:7
積分:2
註冊:2007-09-08

發送簡訊給我
#1 引用回覆 回覆 發表時間:2007-09-15 00:28:30 IP:61.10.xxx.xxx 訂閱
Dear All,
under WinXP, Delphi 7 BDE5.01 Paradox table

My program is very simple
my code is :
------------------------------------------------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
begin
table2.Refresh; // how can i check the value whether is the most updated //
edit2.Text := 'Old Value : ' table2.FieldByName('Remark').AsString;
table2.SetKey;
table2.FieldByName('InventoryNo').AsString := 'A00001';
table2.GotoKey;
table2.Edit;
table2.FieldByName('Remark').AsString := edit1.Text;
table2.Post;
table2.ApplyUpdates;
table2.CommitUpdates;
table2.FlushBuffers;
end;
---------------------------------------------------------------------------------------
When I run my program in 2 PC
At first, there is no problem
but after I click the button from the 2 PC and enter different value into edit1
the edit2 cannot get the updated value from the table2.

How can I solve this problem ?

Thx
P.D.
版主


發表:603
回覆:4038
積分:3874
註冊:2006-10-31

發送簡訊給我
#2 引用回覆 回覆 發表時間:2007-09-15 02:24:49 IP:61.67.xxx.xxx 未訂閱
please try it.

table2.Refresh ==> change to close and open
table2.close;
sleep(1000);
table2.open;
homing
一般會員


發表:4
回覆:7
積分:2
註冊:2007-09-08

發送簡訊給我
#3 引用回覆 回覆 發表時間:2007-09-15 11:28:15 IP:61.10.xxx.xxx 訂閱
thx
但為什麼 Refresh 不可更新澬科 原因在那裡 ?
P.D.
版主


發表:603
回覆:4038
積分:3874
註冊:2006-10-31

發送簡訊給我
#4 引用回覆 回覆 發表時間:2007-09-15 13:49:43 IP:61.67.xxx.xxx 未訂閱
原因要問Borland囉! Refresh 看似ok,但對 paradox 似乎沒有效用,因為唯有close一途才會把cachebuffer 真正的清空,你才有辦法refresh 資料,這是我以前使用paradox 時就發現的問題,不過對你的需求我不知道這是否可以符合你要的目的,因為沒有看你的整個環境,所以才請你試試,如果可用就恭喜你!
homing
一般會員


發表:4
回覆:7
積分:2
註冊:2007-09-08

發送簡訊給我
#5 引用回覆 回覆 發表時間:2007-09-15 22:56:32 IP:61.10.xxx.xxx 訂閱
謝謝
系統時間:2024-05-21 13:53:33
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!