TTable元件來找資料 |
答題得分者是:tech_state
|
kenbcb
中階會員 發表:171 回覆:129 積分:60 註冊:2003-07-15 發送簡訊給我 |
請問各位:
我用TTable元件來找資料,但發生了問題不知如何解決,請幫幫忙
void __fastcall TfrmClient::Timer2Timer(TObject *Sender) { //per 3 second check DB have send Message sigal AnsiString MSG; Timer2->Enabled = false; Table1->First(); while(!Table1->Eof) { if(Table1->FieldByName("Status")->AsBoolean == false && Table1->FieldByName("ID")->AsString != "" ) { MSG = Table1->FieldByName("MSG")->AsString; edtMessage->Text = MSG; Table1->FieldByName("Status")->AsBoolean = true; Table1->Post(); } Table1->Next(); } Timer2->Enabled = true; } |
tech_state
版主 發表:44 回覆:638 積分:641 註冊:2003-02-10 發送簡訊給我 |
kenbcb, 您好
試試加入以下紅色部分
引言: 請問各位: 我用TTable元件來找資料,但發生了問題不知如何解決,請幫幫忙================================= 涵養怒中氣。謹防順口言。留心忙裡錯。珍惜有時錢。 是非終日有,不聽自然無 天下本無事,庸人自擾之void __fastcall TfrmClient::Timer2Timer(TObject *Sender) { //per 3 second check DB have send Message sigal AnsiString MSG; Timer2->Enabled = false; Table1->Active = true; Table1->First(); while(!Table1->Eof) { if(Table1->FieldByName("Status")->AsBoolean == false && Table1->FieldByName("ID")->AsString != "" ) { MSG = Table1->FieldByName("MSG")->AsString; edtMessage->Text = MSG; Table1->FieldByName("Status")->AsBoolean = true; Table1->Post(); } Table1->Next(); } Timer2->Enabled = true; } |
kenbcb
中階會員 發表:171 回覆:129 積分:60 註冊:2003-07-15 發送簡訊給我 |
|
tech_state
版主 發表:44 回覆:638 積分:641 註冊:2003-02-10 發送簡訊給我 |
kenbcb, 您好
試試加入以下紅色部分
引言: 請問各位: 我用TTable元件來找資料,但發生了問題不知如何解決,請幫幫忙================================= 涵養怒中氣。謹防順口言。留心忙裡錯。珍惜有時錢。 是非終日有,不聽自然無 天下本無事,庸人自擾之void __fastcall TfrmClient::Timer2Timer(TObject *Sender) { //per 3 second check DB have send Message sigal AnsiString MSG; Timer2->Enabled = false; Table1->Active = true; Table1->First(); while(!Table1->Eof) { if(Table1->FieldByName("Status")->AsBoolean == false && Table1->FieldByName("ID")->AsString != "" ) { MSG = Table1->FieldByName("MSG")->AsString; edtMessage->Text = MSG; Table1->Edit(); Table1->FieldByName("Status")->AsBoolean = true; Table1->Post(); } Table1->Next(); } Timer2->Enabled = true; } |
kenbcb
中階會員 發表:171 回覆:129 積分:60 註冊:2003-07-15 發送簡訊給我 |
請問:
在綠色字 為什麼不能更改狀態~ 請指導,謝謝!
void __fastcall TfrmClient::Timer2Timer(TObject *Sender) { //per 3 second check DB have send Message sigal AnsiString MSG; Timer2->Enabled = false; Table1->Active = true; Table1->First(); while(!Table1->Eof) { if(Table1->FieldByName("Status")->AsBoolean == false && Table1->FieldByName("ID")->AsString != "" ) { MSG = Table1->FieldByName("MSG")->AsString; edtMessage->Text = MSG; Table1->Edit(); Table1->FieldByName("Status")->AsBoolean = true; Table1->Post(); } Table1->Next(); } Timer2->Enabled = true; } |
tech_state
版主 發表:44 回覆:638 積分:641 註冊:2003-02-10 發送簡訊給我 |
kenbcb, 您好
請參考Help檔的詳細資料,如下
Examine State to determine the current operating mode of the dataset. State determines what can be done with data in a dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as an application processes data. Opening a dataset changes State from dsInactive to dsBrowse. An application can call Edit to put a dataset into dsEdit state, or call Insert to put a dataset into dsInsert state. If a dataset is a TTable or TClientDataSet object, an application can call SetKey or SetRange to put the dataset into dsSetKey state. Posting or canceling edits, insertions, or deletions, changes State from its current state to dsBrowse. Closing a dataset changes its state to dsInactive. Some states, such as dsCalcFields, dsFilter, dsNewValue, dsOldValue, and dsCurValue cannot be seen or set directly by an application. These states are automatically set when OnCalcFields and OnFilterRecord events occur, or when an application accesses certain field properties. =================================
涵養怒中氣。謹防順口言。留心忙裡錯。珍惜有時錢。
是非終日有,不聽自然無
天下本無事,庸人自擾之
|
kenbcb
中階會員 發表:171 回覆:129 積分:60 註冊:2003-07-15 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |