请问TADOStoredProc控件如何用?我要用ADOStoredProc1调用存储过程,并且是带有参数的,大哥能交交我吗?

解决方案 »

  1.   

    SP_GroupStore->Close();//TADOStoredProc参数通过如下方法赋值:
    SP_GroupStore->Parameters->ParamByName("@OprName")->Value = "张明";
    SP_GroupStore->Parameters->ParamByName("@RepDate")->Value = "2003-02-14";
    SP_GroupStore->Parameters->ParamByName("@MassCode")->Value = "RA-100";SP_GroupStore->Prepared = true;
    SP_GroupStore->ExecProc();
      

  2.   

    SP_GroupStore.procedurename:='aaaa;1';//过程名
    //输入参数
    SP_GroupStore.Parameters.ParamByName("@OprName")->Value:= "张明";
    SP_GroupStore.Parameters.ParamByName("@RepDate")->Value:= "2003-02-14";
    SP_GroupStore.Parameters.ParamByName("@MassCode")->Value:= "RA-100";
    SP_GroupStore.Prepared:= true;
    SP_GroupStore.ExecProc();
    //输出参数
    mycode:=SP_GroupStore.Parameters.ParamByName("@MyCode")->Value;