procedure TForm1.RadioButton1Click(Sender: TObject);
begin
  with adotable1 do
  begin
   Active:=false;
   Close;
   TableName:='sales';
   Open;
   Active:=true;
  end;
   s:=0;
end;procedure TForm1.RadioButton2Click(Sender: TObject);
begin
 with adotable1 do
  begin
   Active:=false;
   Close;
   TableName:='sales2';
   Open;
   Active:=true;
  end;
   s:=1;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
   with adoquery1 do
   begin
    close;
    sql.Clear;
    case s of
    0:sql.Add('exec addcttosales');//我不希望执行第二次。如何判断?
    1:sql.Add('exec addcttosales2');//
    end;
    execsql;
    Active:=False;
    Close;
    SQL.Clear;
    case s of
     0:SQL.Text:='select * from sales';
     1:SQL.Text:='select * from sales2';
    end;
   end;
   adotable1.Close;
   case s of
   0: ADOTable1.TableName:='sales';
   1: ADOTable1.TableName:='sales2';
   end;
   ADOTable1.Open;
   adotable1.Active:=true;
end;
选择了radiobutton1后,再按button1,执行了exec addcttosales。那当我再按button1时如何判断我已经执行过这个存储过程了。
对话框的提示语言是“已经求出季节性系数”

解决方案 »

  1.   

    那就设置个变量,只要执行你的那个存储过程,就设置它为某一个值,然后外面再设置一个变量,比如外面的i:=0里面的j执行一次就加一,然后就是j:=1
    i<>j 就不执行 ,判断完毕后再设置j:=0
      

  2.   

    button1.tag 可以标记.. 不用在用变量了..
      

  3.   

    tag?什么东东,好像不太清楚,请说说