在三层结构中如何使用adostoreproce调用SQLSERVER2000中带参数的存储过程?

解决方案 »

  1.   

    在应用服务器中放入adostroedproc连接上相应的存储过程
    在客户端使用clientdateset与之连接,获得他的参数,然后对应他的参数设置即可
      

  2.   

    例子!
    DM_Client.StoredProc.Close;
      DM_Client.StoredProc.ProcedureName:='XY_INSERT';
      DM_Client.StoredProc.Parameters.Clear;
      DM_Client.StoredProc.Parameters.Refresh;
      DM_Client.StoredProc.Parameters.ParamValues['IX_ID']:=Trim(edt_gbxyid.Text);
      DM_Client.StoredProc.Prepared:=True;
      DM_Client.StoredProc.ExecProc;
    还有注意,有可能存储过程当中的输出参数,也要提前付值
      

  3.   

    好象要在clientdataset的commandtext属性中设置参数执行存储过程,该怎么设置,SQLSERVER上的存储过程有多个参数?
      

  4.   

    跟一般sql语句一样,
    Ado.CommandText:='exec Your_SP_Name :param1,:Param2'
    Ado.ParamByName['Param1']:='haha';
    Ado.ParamByName['Param1']:='hehe';
      

  5.   

    对,和一般的SQL语句一样就可以了