 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Brian Hollister Guest
|
Posted: Tue Jun 06, 2006 10:46 pm Post subject: SPs executing two times |
|
|
Hi,
I wrote one routine that could be called to refresh a Calendar display. This
is the code block;
procedure TfrmdeCalendar.DoGetAppts_SingleRes;
begin
// safety
If Length(apptsFor) <= 0 then
begin
MessageDlg(ceNoResourceSelected, mtWarning, [mbOK], 0);
Exit;
end;
If Schedule.DateNavigator.Date = 0 then
begin
MessageDlg(ceNoDateSelected, mtWarning, [mbOK], 0);
Exit;
end;
with adoAppts do
begin
If Active then
Active := false;
Parameters.Refresh;
Parameters.ParamByName('@resIndex').Value := StrToInt(apptsFor);
Parameters.ParamByName('@startingDate').Value :=
Schedule.DateNavigator.Date;
// ending date will change depending what view mode we are in
// until I hear from DevEx just use DayView to begin with
Parameters.ParamByName('@endingDate').Value :=
Schedule.DateNavigator.Date + 1;
Open;
end;
end;
adoAppts belongs to the form in this case. The above code gets executed once
in the FormCreate.
When the user chages the date range to display and i need to update the data
displayed. I call the same method above. However, i get the following
message;
adoAppts: Parameter '@resIndex' not found.
What can i do to avoid this? The method above may be called a zillion times
if the user just sits there in calendar analyzing the events to come.
Thank you,
brian
--
Got a big event coming up? Let us
help coordinate your event. For more
visit www.kissemgoodbye.com |
|
| Back to top |
|
 |
Kevin Frevert Guest
|
Posted: Tue Jun 06, 2006 11:16 pm Post subject: Re: SPs executing two times |
|
|
"Brian Hollister" <bhollisterATfuturaintlDOTcom> wrote in message
news:4485bf83$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
What can i do to avoid this? The method above may be called a zillion
times
if the user just sits there in calendar analyzing the events to come.
|
If you created the parameters at design time and not modifying the
underlying SQL at run time, there is no need to call Parameters.Refresh.
Good luck,
krf |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|