QueryTemp1.SQl.Add('select max(''Xuhao'') as No  table  where z=:z'); if QueryTemp1.IsEmpty  then//数据表是空的,没有max数据
  begin                 //应该是则行这一句的,但是老是跳过这一句??
     Result:='1';
     Abort;
  end  else begin //跳到这一句运行,为什么,max的问题吗???
    Result:=QueryTemp1.FieldByName('No').asstring)+1;
  end;