.........
begin
table1['postmove']:='­×§ï';
bo:=false;
END;
i:=0;
i1:=0;
I2:=0;
table2.First;
while not table2.Eof do
begin
if table2['styleno']<'0' then
table2.Delete
else
........这是其中的一部分,现在插入数据时如果中间有空行,它一次只能删除二个空行,如果大于三个的话就不行了,
那们高手能不能帮我改进一下,看能不能一下全部删除!多谢了!

解决方案 »

  1.   

    为什么不用SQL语句来删除这些空行?
      

  2.   

    你搞错了,
    当你删除上面的记录时,下面的记录会自动向上移动!
    要不从最后一条记录向上删除,
    table2.Last;
    while not table2.Bof do
    begin
    if table2['styleno']<'0' then
    table2.Delete
    else
    ........table2.prior;
    end
      

  3.   

    倒过来处理就可以了,因为你删除了一条记录以后,后面的记录会自动往前填补,这样你刚删除的这条记录的位置如果刚好又被新的空记录填补,而下一步你的记录集指针就往前走了,那么当前的空纪录就没法删除了
    table2.Last;
    while not table2.Bof do
    begin
    if table2['styleno']<'0' then
    table2.Delete
    else
    ...
      

  4.   

    你搞错了,
    当你删除上面的记录时,下面的记录会自动向上移动!
    要不从最后一条记录向上删除,
    table2.Last;
    while not table2.Bof do
    begin
    if table2['styleno']<'0' then
    table2.Delete
    else
    ........table2.prior;
    end
      

  5.   

    你搞错了,
    当你删除上面的记录时,下面的记录会自动向上移动!
    要不从最后一条记录向上删除,
    table2.Last;
    while not table2.Bof do
    begin
    if table2['styleno']<'0' then
    table2.Delete
    else
    ........table2.prior;
    end
      

  6.   

    table不好用,还是用query或ado吧
      

  7.   

    不会吧,没有反应,就这个程序,那个高手能用query改一下?