Problem with accessing parameters in IBCStoredProc
Posted: Sun 22 Jul 2007 08:27
Because IBCStoredProc don't store parameter types and names in DFM by default (and automatically determine information during preparation), call ParamByName(XXX) without explicit preparation of stored procedure raise exception 'Parameter 'XXX' not found'.
Setting AutoPrepare in Options property don't solve this problem.
Solution is setting ParamCheck to False, invoke StoredProc editor (by double clicking on component) for preparation, changing editor tab to "Parameters" (parameters list filled automatically) and save form (in this case Params property stored in DFM), or folowing code appendix:, but complex application needs too much annoying changes.
FireBird 2.01, Delphi 7, IBDac 2.10.0.9
PS: sorry for my "english"!
Setting AutoPrepare in Options property don't solve this problem.
Solution is setting ParamCheck to False, invoke StoredProc editor (by double clicking on component) for preparation, changing editor tab to "Parameters" (parameters list filled automatically) and save form (in this case Params property stored in DFM), or folowing code appendix:
Code: Select all
with IBCStoredProc1 do begin
if not Prepared then
Prepare;
ParamByName(XXX).As... := ...;
.....
ExecProc;
end;
FireBird 2.01, Delphi 7, IBDac 2.10.0.9
PS: sorry for my "english"!