各位大侠,请问如何使用ADOX取一个存储过程的参数列表及其相关参数类型?

解决方案 »

  1.   

    function InitStoredProc(SP:TStoredProc;StoredProcName:string;CheckCount:integer):Boolean;
    var
      Params: TParams;
    begin
      Params := TParams.Create(nil);
      try
        if SP.Active then
          SP.Close;
        SP.StoredProcName:=StoredProcName;
        SP.CopyParams(Params);
        if CheckCount>=0 then   //检查参数的个数是否符合前台程序的要求//
        begin
          if SP.Params.Count=CheckCount then
            result:=true
          else
            result:=false;
        end
        else
        begin
          result:=true;
        end;
      finally
        Params.Free;
      end;
    end;InitStoredProc(Sp1,'sp_myproc',-1);
    然后获取Sp1中的Params就可以了。