改为:
CREATE procedure mypro
@countname int output
as
begin
select count(name) from customer 
end;用storedproc
 with storedproc1 do
 begin
  close;
  m:=parambyname('@countname').asinteger;(先定义m)
  active:=true;
 end;

解决方案 »

  1.   

    tob(tob) :
     好象写的不对吧? 变量@countname只定义了,而没有付值
      

  2.   

    var 
      a : integer;
    strSQL := 'exec mypro' + inttostr(a) + output';
    可用fieldbyname取出结果
    用adoquery就可以。
      

  3.   

    啊写错了,应该是:
    CREATE procedure mypro
    @countname int output
    as
    begin
    select @countname=count(name) from customer 
    end;用storedproc
    with storedproc1 do
    begin
      close;
      m:=parambyname('@countname').asinteger;(先定义m)
      active:=true;
    end;