delphi编程问题语句循环
WithADOPatternDobeginI:=2;Close;SQL.Add(Sti+'and(tiLineFlag='''+IntToStr(2)+''')');Op...
With ADOPattern Do
begin
I := 2 ;
Close;
SQL.Add(Sti+'and (tiLineFlag = '''+IntToStr(2)+''')');
Open;
With StringGrid1 Do
begin
//K := I - 1;
Cells[5, 1] := Trim(IntToStr(FieldByName('Sum').AsInteger));
end;
I := 3 ;
Close;
SQL.Add(Sti+'and (tiLineFlag = '''+IntToStr(3)+''')');
Open;
With StringGrid1 Do
begin
//K := I - 1;
Cells[5, 2] := Trim(IntToStr(FieldByName('Sum').AsInteger));
end;
end;
为何grid中只显示第一条值,循环怎么写可以分别显示相应的值
我发现问题所在了,我没有写SQL清除语句,添加之后OK! 展开
begin
I := 2 ;
Close;
SQL.Add(Sti+'and (tiLineFlag = '''+IntToStr(2)+''')');
Open;
With StringGrid1 Do
begin
//K := I - 1;
Cells[5, 1] := Trim(IntToStr(FieldByName('Sum').AsInteger));
end;
I := 3 ;
Close;
SQL.Add(Sti+'and (tiLineFlag = '''+IntToStr(3)+''')');
Open;
With StringGrid1 Do
begin
//K := I - 1;
Cells[5, 2] := Trim(IntToStr(FieldByName('Sum').AsInteger));
end;
end;
为何grid中只显示第一条值,循环怎么写可以分别显示相应的值
我发现问题所在了,我没有写SQL清除语句,添加之后OK! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询