Subject | Re: [IBO] Still having problems with OnCalculateField |
---|---|
Author | Stuart Hunt |
Post date | 2004-01-15T09:26:48Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
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? The thing that confuses me about
this is that if you use AsString anywhere outside of the
OnCalculateField event it trims the field fine. If we do have to use
FieldsTrimming I assume we simply use:
FULLNAME=r
to right trim?
TIA,
Stuart Hunt
> At 04:08 PM 14/01/2004 +0000, you wrote:with
> >Hi,
> >further to the posting I made earlier, i'm still having problems
> >OnCalculateField events padding string fields in IB Objects 4.3Aa.My
> >complete system is:upgrade
> >Delphi 4 update pack 2(I know this is very old - I'm about to
> >it but decided to do the upgrade a bit at a time)TIB_Statement;
> >InterBase 7.1
> >IB Objects 4.3Aa
> >Windows XP Service Pack 1
> >
> >The problem is still that when I use ARow.ByName('XXX').AsString in
> >the OnCalculatedField method to get a field value it is padding out
> >string fields where it didn't used to. For example, code to return
> >someones name:
> >
> >procedure TfrmDocSel.qryDocumentCalculateField(Sender:
> >ARow: TIB_Row; AField: TIB_Column);have
> >begin
> >AField.AsString:=ARow.ByName('FORENAME').AsString+' '+
> >ARow.ByName('SURNAME').AsString;
> >end;
> >
> >Now returns "Stuart Hunt " instead of "Stuart
> >Hunt". I use calculated fields a lot and therefore don't want to
> >to manually trim the fields for all these cases.using IB
>
> Are you sure these columns are varchar and not char? If you are
> 7.1, there is nothing to trim on varchars, so I'm suspicious. :-)trimming at the
>
> If this *is* the problem, then use the FieldsTrimming attribute to
> eliminate padding in whatever way you desire. This applies
> field level, either in the dataset, or globally if you want, in theproperty
> connection component.
>
> >I have also ensured that the connection's DefaultNoTrimming
> >is FALSE.Helen,
>
> This doesn't trim char types, afaik.
>
> Helen
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? The thing that confuses me about
this is that if you use AsString anywhere outside of the
OnCalculateField event it trims the field fine. If we do have to use
FieldsTrimming I assume we simply use:
FULLNAME=r
to right trim?
TIA,
Stuart Hunt