当然可以
添加StoredProc控件,设置StoredProcedureName设为'dbo.db_backup',再根据存储过程db_backup的参数设置StoredProc的Params属性.
如:
有一存储过程GetEmployeeCount
Create Procedure GetEmployeeCount@InJobID int,@OutCount int out as Select @OutCount=Count(*) From employee Where Job_id=@InJobID
意思是根据Job_id查询属于这个Job_id的总人数OutCount
调用:
StoredProcedureName为dbo.GetEmptyeeCount
Params为:
  TStoredProc.Params[0]  DataType=ftInteger
                         ParamType=ptInput
                         value.Type=Byte
  TStoredProc.Params[1]  DataType=ftInteger
                         ParamType=ptOutput
                         value.Type=Byte代码:
Begin
  try
   StoredProc1.Params[1].value:=StrToInt(EditJobID.text);
   StoredProc1.Prepare;
   StoredProc1.ExecProc;
   EditCount.Text:=IntToStr(StoredProc1.Params[2].value);
  finally
   ShowMessage('Ok');
  end;
end;手都打累了,够了吧?

解决方案 »

  1.   

    非常感谢shift,谢谢您 
    我问的没表达清楚,我要调用的是sql server中的系统存储过程,不是自定义的。
    在此调用的应是backup或restore,但在StoredProcedureName并没有这两个,仅有我自定义的,
    要想用系统存储过程是不是还要设控件的其它属性值,但我没找到。
    如果您知道的话,不妨再麻烦您一下。十分谢谢!
      

  2.   

       作備份應該是ADM來做的﹐為什么要在程序里寫﹐如果要作﹐可以在程序里建臨時的table,
    把要備份的數據往里面塞