如何像设置query控件那样设置StoredProc控件,
我设置后提示无法找到存储过程。
我让datasource的dataset为StoredProc1
然后storedproc1的storedprocname为
dbo.t_saft_hidden_trouble_command;1
然后设置params的参数的输入输出属性
最后设置StoredProc1的active为true
提示无法找到dbo.t_saft_hidden_trouble_command;1
存储过程,为什么?
改如何设置,如果用ado如何设置?
谢谢。

解决方案 »

  1.   

    ado比较简单,
    把ADOStoredProc1连接设上。
    with ADOstoredproc1 do
    begin
      close;
      procedurename:='过程名;1';
      parameters.refresh;
      parameters.parambyname('@dfs').value:='sdf';
      //如果返回数据集用open;
      open;
      //如果不返回数据集用ExecProc
      ExecProc; 
    end;
      

  2.   

    如果用TStoredProc,建议你看一看以下的文章:
    http://www.elists.org/pipermail/delphi-talk/2003-September/018111.html如果用ADOStoredProc,与TStoredProc非常相似。
    ADOStoredProc可以设置connection属性,或ConnectionString属性来连接数据库,ADOStoredProc有Parameters属性与TStoredProc的Params属性对应。不要怕出问题,多摸摸就熟练了!
      

  3.   

    楼上讲的不错,先设adoconnection, active以后,在storedprocname 的下拉框中就可以看到存储过程的名字了。然后设置Parameters.
    没有返回结果集的无法 active := true
      

  4.   

    我已经能看到存储过程了,但是就是设置TStoredProc的active为true的时候提示的。
    参数也能选择了。
      

  5.   

    用ado比较好,bde有问题.
    先把要输入的参数设好,
    必需有结果集返回才行.
    否则要报错的.