比如:
var aa:string;
  ADOStoreprocname.execproc;
  aa:=ADOStoreprocname.paramer.parabyname('paraname').value;

解决方案 »

  1.   

    with ADOStoredProc1 do begin  Close;
      ShowMessage(VarToStr(Parameters.ParamByName('@OutParam1').Value));
      ExecProc;
    end;在delphi help文件上看到,上面的代码我直接运行,系统报错?那么它可能存在什么问题?
      

  2.   

    ping2000(乐乐) 说得没有错的。
    就是这么简单。
    出错可以是因为数据库服务器上存贮过程参数没有加output声明。。
      

  3.   


      ExecProc;
      ShowMessage(VarToStr(Parameters.ParamByName('@OutParam1').Value));
    这样就对了,Execproc应该在前面,你想想还没执行,怎么会有参数返回?
    解决了,要给分哟!