Subject query.invalidatesql and query.refresh
Author james_027
query.invalidatesql and query.refresh

am I right to say that the refresh method is useless without calling
the invalidatesql first? and Iam confuse on the sqlwhereitems
property.

I have a code like this for the onclick of a button

query.sqlwhereitems.clear; // line 1
query.sqlwhereitems.add(' date >= ''1/1/03'''); // line 2
query.invalidatesql; // line 3
query.refresh; // line 4

well this code doesn't work it doesn't filter the record from 1/1/03
and beyond. but if the put the line 1 and line 2 on the onprepare
event of the query it works. doesn't this means that sqlwhere,
sqlorder, and etc and only be manipulated in onprepare event?

I try to investigate what happen to my sqlwhereitems, and it seems
that the items in sqlwhereitems were erase when the qeury reach on
the onprepare event. So what I did is I remove the line 3. the
sqlwehreitems that I declare on my button onclick event didn't
disappear but calling the refresh method only doesn't really refresh
the record after all.

thanks to help me better understand this.