Subject TIB_Date and query parameter
Author radevojvodic
Hi,

I had some problems with posting messages to the group so i sent this
message to Jason directly. Here is what I found about TIB_Date and
query (or stored procedure) parameter editing.

The problem is that if you have query or stored procedure with date
parameter e.g

Select field1
where field1 > :startdate
from table1

and you put TIB_Date on form and assign IB_Datasource of given
IB_query and assign Paramname=STARTDATE then you won't be able to
pick a date from calendar but you will be able to enter a date from
keyboard. So, I started lookin in IBC_DATE.IMP and in line 53 i found
following statement:

procedure TIB_CustomDate.DatePickChange( Sender: TDatePick;
Value: TDatePickResult );
begin
// hide calendar first
FDatePick.HideCalendar;
if Value = dpNoChanges then Exit;
// check return value and do corresponding action
if Assigned( Field ) then
begin
// check if update possible
--> if not DataLink.Modify then <---
Exit;

and it seems that the problem is in that statement. If you change
this statement to:

if not (DataLink.Modify or DataLink.IsParamEdit) then
Exit;

everything is working fine. Now you can enter value of the parameter
or pick one form calendar and have it assigned to a query parameter
imediatly.

P.S.
IBO 4.2. G, Delphi 6, Interbase 6