procedure TForm1.Button1Click(Sender: TObject);
var
ret:integer;
begin
   with adoquery1 do
   begin
    close;
    sql.Clear;
    case s of
    0:sql.Add('exec addcttosales');
    1:sql.Add('exec addcttosales2');
    end;
    if adoquery1.FieldByName('季节性系数').IsNull then
      execsql
    else
      ret:=application.MessageBox('已经计算出季节性系数!','提示',
           mb_iconinformation+mb_ok+mb_defbutton1);
    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;在执行完存储过程后,sales和sales2表格中的季节性系数有值了,不是“null”了,需要在第二次按button后,不要在执行已经执行过的存储过程了。
但到条件判断处,中断了,“Adoquery1 Field '季节性系数'not found.'
好麻烦,我试过用变量表示,执行存储过程后,用变量做判断条件,但达不到我要的效果。我已经发过帖子了。提到这个问题。
怎么办???