Subject Re: [IBO] Still having problems with OnCalculateField
Author Helen Borrie
At 09:26 AM 15/01/2004 +0000, you wrote:
>--- In, Helen Borrie <helebor@t...> wrote:
> > Are you sure these columns are varchar and not char? If you are
>using IB
> > 7.1, there is nothing to trim on varchars, so I'm suspicious. :-)
> >
> > If this *is* the problem, then use the FieldsTrimming attribute to
> > eliminate padding in whatever way you desire. This applies
>trimming at the
> > field level, either in the dataset, or globally if you want, in the
> > connection component.
> >
> > >I have also ensured that the connection's DefaultNoTrimming
> > >is FALSE.
> >
> > This doesn't trim char types, afaik.
> >
>thanks for this. The fields ARE Char fields - a CHAR (15) and a CHAR
>(30). I assume that what you're saying therefore is that IB Objects
>now returns Char fields untrimmed?

It does and always did - unless you trimmed them yourself. Char and
varchar are different data types and the SQL type information returned on
each is specific. IBO knows not to autotrim chars.

>The thing that confuses me about
>this is that if you use AsString anywhere outside of the
>OnCalculateField event it trims the field fine.

AsString reads a variant. Delphi doesn't have fixed length character types.

>If we do have to use
>FieldsTrimming I assume we simply use:
>to right trim?

If FULLNAME is a database column, yes. Weren't we talking here about

If you want to set this globally, do it in the FieldsTrimming property of
the ib_connection:

and so on.