Problems with Tparam and TQuery

   I use A TQuery created dynamically and 3 TParam also created dynamically.
I will show you a example of my code.
q1: TQuery;
p1, p2: Tparam
q1 := TQuery.create(self);
   p1 := TParam.create(params, ptInput);
   p2 := TParam.create(params, ptInput);
      params[0].name := 'dsdss';
      params[0].datatype := ..
    Here I put some code and in the finally
  Finally;;   But here a have always an illegal acces memory

  But when I trace the program all of the params are correctly created.
Could you help me.

And another thing.
Do you know if its possible to set a filter in a table on a field of type
INTEGER.  I have always this error : Operation not applicable.

Thank you
Daniel Bernier