Locating and select record with input Tedits |
答題得分者是:Justmade
|
Vashee
初階會員 發表:38 回覆:87 積分:25 註冊:2003-03-31 發送簡訊給我 |
Can Name Candidate No Subject No Mark Remark
____________________________________________________________________
Jack 6100 12345 70
Mary 6102 10456 88
John 6161 12345 70 A table is demonstrate above and store noted ADOTable1 Now data is entered in the 5 Tedits Can_Name: Jack
Candidate No: 6100
Subject No: 12345
Mark: 70 Re-mark: 99 (This data should be added to the table) What is the syntax using the 4 Tedits above to locate and select the record in the table and add 99 to the (Remard field)? This is really hard for me
|
Justmade
版主 發表:94 回覆:1934 積分:2030 註冊:2003-03-12 發送簡訊給我 |
using all 4 fields to locate :
if ADOTable1.Locate('Can Name;Candidate No;Subject No;Mark', VarArrayOf([Edit1.Text,Edit2.Text,Edit3.Text,StrToInt(Edit4.Text),[loCaseInsensitive]) then
ADOTable1.FieldByName('Remark').Value := Edit5.Text; **If your Candidate No / Subject No is integer, you have to use StrToInt as well. BUT, if your Candiate No Subject No is unique (primary key?), you should only use that 2 field to search instead of all 4 field.
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |