Problem with table updating with dbedit |
尚未結案
|
Vashee
初階會員 發表:38 回覆:87 積分:25 註冊:2003-03-31 發送簡訊給我 |
Say a table is linked up a ADOTable: A button is created with the following code:
ADOTable.Append; 2 DBedits is linked to the table. When then button is pressed, data is input into the table directly. and the dbgrid shows the information is added.
However, if I look up this table using another lookup components, the added record doesn't exist. Also, if I exit the program this record will not be saved too. My previous project seems to have this problem overall.
Any reason can explain this?
|
problemman
一般會員 發表:7 回覆:25 積分:16 註冊:2003-04-11 發送簡訊給我 |
Did you set the property "LockType" in "ltBatchOptimistic" of ADOTable ? "ltBatchOptimistic" mean set the ADOTable in cached mode that all of the records are retrieved from database server, then saved in the local dirve.So if you do any action (e.g. Insert, update, delete) it only affect in local data , not in the database server. So if you want to save all of the records to the database server
Please write down this code:
ADOTable.Update; ADOTable.UpdateBatch;發表人 - problemman 於 2003/04/12 11:41:05 |
Vashee
初階會員 發表:38 回覆:87 積分:25 註冊:2003-03-31 發送簡訊給我 |
|
problemman
一般會員 發表:7 回覆:25 積分:16 註冊:2003-04-11 發送簡訊給我 |
引言: Should I put this coding inside DBEdit On Change?if you want to see the "added record" in your lookup components, you must applyupdate the record to the database server(note if your ADOTable is in the batch mode). then close and open the ADOTable. see the lookup Components. That Ok.< >< > Note don't put the coding in "OnChange" procedure otherwise it will run that coding automatically when you type any wording on this DBedit. you should write in this. procedure TForm1.Button1Click(Send:TObject); begin ADOTable.ApplyUpdate; ADOTable.Close; ADOTable.Open; end; 《觸不到的問題人》 來無影,去無踪, 問題總是一羅羅。 發表人 - problemman 於 2003/04/15 15:06:31 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |