이 소스중...
procedure TFormTable.F1Query(scd: String);
에서...while not Query1.eof do 를 돌면서 무한루프로 빠져버리는데...
뭐가 문제인지 아시는분 좀 알려주세요
procedure TFormTable.TabControl1Change(Sender: TObject);
var
i: integer;
begin
With TabControl1 do
begin
if TabIndex = 0 then
begin
F1.ClearRange(2,1,5000,20,F1ClearValues);
Query1.Filtered := False;
Query1.Close;
Query1.Open;
i := 2;
while not Query1.eof do
begin
F1.SetActiveCell(i, 1);
F1.Text := Query1.FieldByName('BIZ_NAME').AsString;
F1.SetActiveCell(i, 2);
F1.Text := Query1.FieldByName('ZIPCODE').AsString;
F1.SetActiveCell(i, 3);
F1.Text := Query1.FieldByName('ADDRESS').AsString;
F1.SetActiveCell(i, 4);
F1.Text := Query1.FieldByName('S_NM').AsString;
Inc(i);
Next;
end;
end
else if TabIndex = 1 then
F1Query('100101')
else if TabIndex = 2 then
F1Query('100102')
else if TabIndex = 3 then
F1Query('100103')
else if TabIndex = 4 then
F1Query('100104');
end;
end;
procedure TFormTable.F1Query(scd: String);
var
i : integer;
begin
With TabControl1 do
begin
F1.ClearRange(2,1,5000,20,F1ClearValues);
Query1.Filtered := true;
Query1.Filter := 'F_RP_S_CD = '''+ scd+'''';
Query1.Close;
Query1.Open;
i := 2;
while not Query1.eof do
begin
F1.SetActiveCell(i, 1);
F1.Text := Query1.FieldByName('BIZ_NAME').AsString;
F1.SetActiveCell(i, 2);
F1.Text := Query1.FieldByName('ZIPCODE').AsString;
F1.SetActiveCell(i, 3);
F1.Text := Query1.FieldByName('ADDRESS').AsString;
F1.SetActiveCell(i, 4);
F1.Text := Query1.FieldByName('S_NM').AsString;
Inc(i);
Next;
end;
end;
end;
"Query1.Next;" 로 바꾸면 안 되나요?