Subject | [IBO] Re: Accessing 'previous' values during posting/commiting |
---|---|
Author | bamber12001 |
Post date | 2004-10-14T10:03:01Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
qryBudgetItems is a TIB_Query and I am not using ActiveX at all in
this program. I am running the routine in the associated
transaction's AfterCommit event - I presume this is OK?
Gary.
> At 08:47 AM 14/10/2004 +0000, you wrote:wrote:
>
>
> >--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...>
> > > At 03:04 PM 13/10/2004 +0000, you wrote:want
> > >
> > >
> > > >Hi all,
> > > >
> > > >I have a database which stores budget and forecast figures. I
> > > >to keep track of any changes to these figures in a text file.This
> > > >text file should store the before and after values, everytimea
> > > >record is changed.my
> > > >
> > > >I know I can access the previous values using OLD and NEW in
> >SQLthis
> > > >query (in the UpdateSQL section), but is there anything like
> > > >available on the Delphi side of things?have
> > > >
> > > >I tried using the Buffer information, but this only seemed to
> > > >the new value's.editted,
> > > >
> > > >I can obviously take a copy of the values before they are
> > > >but I would prefer to do it a 'clever' way!reference
> > >
> > > Fields.OldValues['NameOfColumn'].AsString
> > >
> > > Helen
> >
> >
> >Thanks Helen, but I am getting an error 'variant does not
> >an automation object' when I try to access these fields.won't work if
> >
> >Here is my procedure - can you see where I am going wrong?
> >
> >
> >procedure TCustomerBudgetCreateFRM.WriteOriginalForecastFigures;
> >var
> > monthnum: shortint;
> >begin
> > // Write the OLD figures to file
> > WriteLn(fileForecastBackups, 'ORIGINAL VALUES:');
> > qryBudgetItems.First;
> > for monthnum := 1 to 12 do
> > begin
> > WriteLn(fileForecastBackups, ' ' +
> >qryBudgetItems.Fields.OldValues['DESCRIPTION'].AsString
> > + ' : Q ' +
> >qryBudgetItems.Fields.OldValues['FORECAST_QUANTITY'].AsString
> > + ', V ' +
> >qryBudgetItems.Fields.OldValues['FORECAST_VALUE'].AsString
> > + ', M ' +
> >qryBudgetItems.Fields.OldValues['FORECAST_MARGIN'].AsString);
> > qryBudgetItems.Next;
> > end;
> >end;
>
> Nothing obvious...what is qryBudgetItems? Fields.Oldvalues[]
> you are referencing a TIBOQuery. You'd need to access theInternalDataset
> property.['FORECAST_MARGIN'].AsString
>
> qryBudgetItems.InternalDataset.OldValues
>guess. Do you
> But where the automation object error comes from is anyone's
> have ActiveX in the picture?Helen,
>
> Helen
qryBudgetItems is a TIB_Query and I am not using ActiveX at all in
this program. I am running the routine in the associated
transaction's AfterCommit event - I presume this is OK?
Gary.