Recent

Author Topic: TSQLQuery: parameters gone when re-opening Lazarus  (Read 5766 times)

timmermanj

  • New Member
  • *
  • Posts: 39
TSQLQuery: parameters gone when re-opening Lazarus
« on: January 14, 2010, 08:39:43 am »
I have a very annoying problem. I hope anybody can help!

I' am trying to do some SQL-querys with parameters.
The component I use is the TSQLQuery - component.

I can add some parameters (See attachment) in the IDE.

But if I save the project, Close & re-open Lazarus finally open my project again, all my parameters in my SQL-component are gone!

Anybody knows why and how I can solve this?

Thanks a lot!

timmermanj

  • New Member
  • *
  • Posts: 39
Re: TSQLQuery: parameters gone when re-opening Lazarus
« Reply #1 on: January 14, 2010, 08:54:57 am »
Forgot to mention when I re-opened LAzarus& my project (the parameters are gone).
I've tried to run the program again & ... it worked.

So if my query works, this means that the parameter still exists in the TSQLQuery - component. They are just not visible anymore in the params - list of this component.

Anybody any methods so I can view them again?

Thanks a lot!

LacaK

  • Hero Member
  • *****
  • Posts: 703
Re: TSQLQuery: parameters gone when re-opening Lazarus
« Reply #2 on: January 14, 2010, 12:41:28 pm »
Can you check frmDetail.lfm file?

And look for :

  object qryDetail: TSQLQuery

    Params = <   
      item
        DataType = ftInteger
        Name = 'parNr'
        ParamType = ptUnknown
      end>
  end

If you find it, then Param info is stored and should be restored when you open form again.

But problem may be if property ParseSQL=True,
then Params are build according to supplied SQL and extracted from SQL.Text (so stored Params are lost).
But if your SQL.Text contains something like: ... where Nr=:parNr ... then Params should show "parNr" ...

 

TinyPortal © 2005-2018