There is no way, experts are invited!

Category: Delphi -> VCL/Component Author: sbyangzelin Date: 2010-11-16 02:39:46
 
sbyangzelin
2010-11-16 02:39:46
Brother to do a procedure, the original table T_kb who is the teach_id into 2000 + teach_id then add the other field information into this table, the result is an executable small part of the record does not append, and whatever it kinds of situations are just less 55, what they are and no particular place? Good feelings! !

procedure TF_kaoshixx.Button1Click (Sender: TObject);
var xkbh, kcdm, kd, st_id, student_team, id: string;
; gd, n, m, i, week, wek: integer;
begin
T_kb.Close;
T_kb. Filter: = 'team =''' + dbedit1.Text +'''';
T_kb.Filtered: = true;
T_kb.Open;
n: = T_kb.recordcount;
i: = 0;
gauge.Progress: = 0;
T_kb.First;
while not T_kb.Eof do
begin
xkbh: = T_kb ['teach_id'];
gd: = 2000 + strtoint (xkbh);
id: = inttostr (gd);
kcdm: = T_kb ['teach_code'];
week: = T_kb ['teach_to_week'];
kd: = kcdm [length (kcdm)];
if kd = '0 'then
wek: = week +1
else
wek: = week;
T_kb.AppendRecord ([id, T_kb ['teach_name'], T_kb [' teach_grade '], T_kb [' teach_class'], T_kb ['teach_type'],
T_kb ['teach_class_id'], T_kb ['teach_student_number'], T_kb ['teach_teacher'], T_kb ['teach_xuan'], T_kb ['teach_code'],
T_kb ['teach_xf'], wek, wek, T_kb ['teach_department'], T_kb ['teach_department_id'], T_kb [ 'team'],
T_kb ['teach_memo'], now]);
inc (i);
; T_kb.Next;
gauge.Progress: = (100 * i) div n;
end;
; B_xuesheng.Enabled: = true;
Button1.Enabled: = false;
showmessage ('build complete');
; end;
srz32
2010-11-16 03:04:25
first Table.last, then use table.first etc., this is TAble issue.
xuehaijingling
2010-11-16 03:31:46
what method to use?
QUERY?
BATCHMOVE?
qiu_shugang
2010-11-16 03:55:29
T_kb.Filter: = 'team =''' + dbedit1.Text +''''

you are not filtered out those records?
a373217308
2010-11-16 04:25:44
right ah, I filtered out those records?