是这样的,有二个表之间有关联关系。而且二个表的数据量都很大,原来是这样写的。
table1.first;
while not table1.eof do
begin
xh:=table1.fieldbyname('xh').asstring;
query1.Close;
query1.SQL.Text:='select * from table2 where xh='''+xh+''';
query1.Open;
if quey1.IsEmpty then exit;
query1.first;
while not query1.eof do
begin
.......
取出的值再进行下一步计算。
end;
end;
这觉得这样很慢,有没有比这快的方法。求赐教!
table1.first;
while not table1.eof do
begin
xh:=table1.fieldbyname('xh').asstring;
query1.Close;
query1.SQL.Text:='select * from table2 where xh='''+xh+''';
query1.Open;
if quey1.IsEmpty then exit;
query1.first;
while not query1.eof do
begin
.......
取出的值再进行下一步计算。
end;
end;
这觉得这样很慢,有没有比这快的方法。求赐教!
解决方案 »
- ScrollBox变化时怎样设置Form的高度?
- 请人做个小程序。速度联系。
- 如何将Image控件中的图片一分为二存到别两个Image控件中?
- 如何实现让程序浮在最上面,象Realplayer一样
- 如何在界面上动态添加Image
- 如何取得浏览器当前地址栏中的内容?
- RadioItem属性
- 我在动态生成Tabsheet,并将已设计好的Tabsheet上面的所有组件克隆到新生成的Tabsheet上面的时候遇到困难,请大家帮忙。
- 发送邮件问题,为何验证失败,100分奉送!急!
- 请教:如何得到表中字段的类型,如VarChar(1024),而不是ftString等等。
- 目前Delphi中最稳定的版本?
- delphi 7 和GLSCENE 如何用freeform 读取3ds文件自带贴图阿~~
2.包上disablecontrol和enablecontrols
把你的Query1一次性都查出来,然后在本地再做一次While找比你一次次操作数据库快多了.