Subject Re: [IBO] Re: Master detail relationship, Masterlinks with date type
Author Helen Borrie
At 07:46 AM 12/08/2004 +0000, you wrote:
>Thank you for your detailed description, now I see the complexity of
>the problem.
>--- In, Helen Borrie <helebor@t...> wrote:
> > Keying and linking things on dates is fraught with problems, some
> > some not. Borland software was never friendly about non-US date
>formats, so
> > earlier Delphi versions misbehave more than later ones. Very old
> > versions simply don't recognise the ODS 10 SQLTypes. So both
>Delphi and
> > IBO versions might be a factor.
> >
> > Tell us whether you are using native TIB_ components or the
>TDataset (TIBO)
> > ones. It may make a difference.
>I'm using TIB_components.
> > And, of course, the Windows locale affects things somewhere along
>the line,
> > since that's the only way the error handler could have got hold of
>a date
> > literal in ccyy/mm/dd format.
> >
> > >Any ideas?
> >
> > The easiest thing would be to find a way to avoid using date types
> > KeyLinks and MasterLinks.
>I am working on it...
> > Beyond that, with more information about the
> > environment, ways and means might be found.
>I'm using Delphi 6 Professional, IBO4, FireBird 1.5.0.
> > Try forcing the date columns to be cast as TDate. It still won't
> > necessarily solve the problem, though, because a "raw" date
>portion under
> > the hood in Delphi and IBO is mm/dd/ccyy, whereas, at some level,
> > dates are being changed to ccyy/mm/dd.
>What do you mean by forcing the date columns to be cast as TDate?
>I think that setting up MasterLinks with date columns
>(namely MasterLinks.Text:='WDATE=WDATE') causes the problem, but
>I can't cast the columns here, can I?

No; part of the trick would be to have the TIB_Column come through as a
TIB_ColumnDate, not a TIB_ColumnDateTime. But I think it's still possible
that you'll bump into format problems unless *every* casting inside Delphi
is done with AsDate, (not AsDateTime or Value or AsVariant) AND you avoid
reading values from the controls. Experiment with it and use the
IB_MonitorDialog to watch the values that IBO sends through in the
parameters to fetch the detail records.