How to add params to IBCQuery

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
abak
Posts: 29
Joined: Sat 18 Oct 2014 18:42

How to add params to IBCQuery

Post by abak » Tue 14 Apr 2015 18:23

Hello,
I tried to add them in params editor but it is always locked !
How can I do it at Designtime and Runtime ?
Thx.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: How to add params to IBCQuery

Post by ViktorV » Wed 15 Apr 2015 09:22

The Parameters tab in IBCQuery Editor is not designed for parameter addition. Using it, you can edit parameters, that are automatically generated on the basis of the query on the SQL tab.
To add parameters in runtime, you can use the following code:

Code: Select all

  IBCQuery.ParamCheck := False;
  IBCQuery.Params.Clear;
  IBCQuery.SQL.Text := 'select * from dept where deptno = :deptno';
  IBCQuery.Params.CreateParam(ftInteger, 'deptno', ptInput);
  IBCQuery.ParamByName('deptno').AsInteger := 10;
  IBCQuery.Open;

abak
Posts: 29
Joined: Sat 18 Oct 2014 18:42

Re: How to add params to IBCQuery

Post by abak » Wed 15 Apr 2015 19:11

Thank you ViktorV.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: How to add params to IBCQuery

Post by ViktorV » Thu 16 Apr 2015 05:48

Feel free to contact us if you have any further questions about IBDAC.

Post Reply