Board index » delphi » TADOStoredProc does not work at run time

TADOStoredProc does not work at run time

When I use these code:
            UpdateHisDate:=TADOStoredProc.Create(nil);
          UpdateHisDate.Connection:=ADOConnection1;
          UpdateHisDate.ProcedureName:='UpdateHistoryDate;1';
          UpdateHisDate.Parameters.ParamByName('@ID').Value:=tmpID;
          UpdateHisDate.ExecProc;
          UpdateHisDate.free;

To Exec a stored Proc it always raise an error says:
Paramter '@ID' not found , but I can use it at the design time
why?What can I do?
Please help me!

 

Re:TADOStoredProc does not work at run time


Is assigning a new name to your TADOStoredProc blow out your parameters?
Try adding UpdateHisDate.Parameters.Refresh; after you assign the procedure
name.
Also, is the ';1' needed at the end of the procedurename?  I've never added
this before and never had issues with it not working.

Quote
"Thomas Wang" <thomas7...@hotmail.com> wrote in message

news:3ba994e3_1@dnews...
Quote
> When I use these code:
>             UpdateHisDate:=TADOStoredProc.Create(nil);
>           UpdateHisDate.Connection:=ADOConnection1;
>           UpdateHisDate.ProcedureName:='UpdateHistoryDate;1';
>           UpdateHisDate.Parameters.ParamByName('@ID').Value:=tmpID;
>           UpdateHisDate.ExecProc;
>           UpdateHisDate.free;

> To Exec a stored Proc it always raise an error says:
> Paramter '@ID' not found , but I can use it at the design time
> why?What can I do?
> Please help me!

Other Threads