Subject Refresh of TIBOQuery
Author Gerhardus Geldenhuis
Hi

I have the following procedure which I call regularly to change the data
shown in
a grid.(See underneath)

The problems is that if I have called it once it(resultset) does not change
again if you provide different parameters and the result set stays the same.
Changing the parameters have no effect. I checked the monitor and the
parameters does change and the correct result should be obtained from the
server. The problem I think is locally. I am probably doing something simple
or a property somewhere is not set.

The commented code is things I tried, to see if I could get the result set
to change.

procedure FilterDiary;
begin
// dbr.IBOQDiary.Close;
// DBR.IBOQDiary.Active:=False;
if not DBR.IBODatabase1.InTransaction then
DBR.IBODatabase1.StartTransaction;
with DBR.IBOQDiary do
begin
// Params.Clear;
ParamByName('IN_DATE').AsDate:=CurrentDiaryDate;

ParamByName('IN_USER').AsString:=UpperCase(DBR.IBODatabase1.LoginUsername);
if not Prepared then
Prepare;
try
Open;
// Refresh;
// Showmessage(DateToStr(ParamByName('IN_DATE').AsDate));
// Showmessage(ParamByName('IN_USER').AsString);
DBR.IBODatabase1.Commit;
DBR.IBOQDiary.Unprepare;
except
end;//try except
end;//with do

Here is the component properties of IBOQDiary:

object IBOQDiary: TIBOQuery
Tag = 1
Params = <
item
DataType = ftUnknown
Name = 'in_user'
ParamType = ptUnknown
end
item
DataType = ftUnknown
Name = 'in_date'
ParamType = ptUnknown
end>
DatabaseName = 'BodyTrak'
IB_Connection = IBODatabase1
RecordCountAccurate = True
RequestLive = True
SQL.Strings = (
'select * from diary'
'where screenname in'

' (select screenname from useraccess where upper(username) = ' +
':in_user)and'

' department IN (select department from users where upper(userna' +
'me) = :in_user)'
' and datecompleted is null and'
' diary_date = :in_date')
FieldOptions = []
Left = 540
Top = 200
end