不能用Open,而应该用ExecSQL方法。

解决方案 »

  1.   

    为什么不用TADOStoredProc呢,专用的,
    专门调用存储过程的。
      

  2.   

    为什么不用TADOStoredProc呢,专用的,
    专门调用存储过程的。
      

  3.   

    TADOStoredProc?,呵呵,我还不知道这玩意,去试试:)
      

  4.   

    不能用Open,而应该用ExecSQL方法
      

  5.   

    TADOStoredProc都不知道,你的五个角是哪混来的呀,i 服了 u
      

  6.   

    backlove(我愿意):
       呵呵,不好意思,我这两天才开始学delphi的:)刚刚用TADOStoredProc试了,可以了,但是,假如我要带参数,应该怎么写,这样写老不对:
    with form1.adostoredproc1 do
       begin
          procedurename:='mywage';
          parambyname('@lnmonth').asinteger:=6;
          execproc;
       end;存储过程是:
    CREATE PROCEDURE mywage  AS
    declare @lnmonth int
    select a.name,(year(getdate())-year(a.workage)+1)*5 as gl,b.dagz,b.gjj,b.ydj,
       case a.rank 
          when '技术员' then 20 
          when '助工' then 50 
          when '工程师' then 80 
          when '高工' then 100 
       end as zz
    from human a full join wage b on a.nameid=b.nameid and b.wagemonth=@lnmonth
    GO
      

  7.   

    backlove(我愿意):
       呵呵,不好意思,我这两天才开始学delphi的:)刚刚用TADOStoredProc试了,可以了,但是,假如我要带参数,应该怎么写,这样写老不对:
    with form1.adostoredproc1 do
       begin
          procedurename:='mywage';
          parambyname('@lnmonth').asinteger:=6;
          execproc;
       end;存储过程是:
    CREATE PROCEDURE mywage  AS
    declare @lnmonth int
    select a.name,(year(getdate())-year(a.workage)+1)*5 as gl,b.dagz,b.gjj,b.ydj,
       case a.rank 
          when '技术员' then 20 
          when '助工' then 50 
          when '工程师' then 80 
          when '高工' then 100 
       end as zz
    from human a full join wage b on a.nameid=b.nameid and b.wagemonth=@lnmonth
    GO
      

  8.   

    backlove(我愿意):
       呵呵,不好意思,我这两天才开始学delphi的:)刚刚用TADOStoredProc试了,可以了,但是,假如我要带参数,应该怎么写,这样写老不对:
    with form1.adostoredproc1 do
       begin
          procedurename:='mywage';
          parambyname('@lnmonth').asinteger:=6;
          execproc;
       end;存储过程是:
    CREATE PROCEDURE mywage  AS
    declare @lnmonth int
    select a.name,(year(getdate())-year(a.workage)+1)*5 as gl,b.dagz,b.gjj,b.ydj,
       case a.rank 
          when '技术员' then 20 
          when '助工' then 50 
          when '工程师' then 80 
          when '高工' then 100 
       end as zz
    from human a full join wage b on a.nameid=b.nameid and b.wagemonth=@lnmonth
    GO