[DUG] Dbase File Data Update
lbisman
lbisman at clear.net.nz
Tue Oct 28 08:29:39 NZDT 2008
Except Jeremy, it looks like this is incrementing a field in
an existing record. AutoInc fields increment the field in
subsequent records...
The only thing missing from the current code snippet appears
to be a "post" to ensure the record is written. If you move
off the record being edited, it is possible that the update
isn't posted.
Laurie Bisman..
----- Original Message Follows -----
> Another thought would be to make the "JobNo" field an auto
> incrementing field? I have to admit I cant remember too
> much about DBase but I am sure it has auto incrementing
> fields. This would save you needing to calculate the job
> number.
>
> Jeremy
>
> _____
>
> From: delphi-bounces at delphi.org.nz
> [mailto:delphi-bounces at delphi.org.nz] On Behalf Of
> Marshland Engineering Sent: 27 October 2008 18:35
> To: delphi at delphi.org.nz
> Subject: [DUG] Dbase File Data Update
>
>
> I am trying to increase a value in a dbaseIII file. When I
> press the Inc button, the referenced dbEdit field
> increases with each click.
>
> However on exiting the program, the tblData['Jobno'] does
> not reflect the new value.
>
>
> >From data module.
>
> begin
> tblData.open;
> end;
> ------------------------------------
>
> procedure TForm1.bIncClick(Sender: TObject);
>
> var iCurrJobno:integer;
>
> begin
> iCurrJobno:=dm.tblData['Jobno'];
> iCurrJobno:= iCurrJobno+1;
> dm.tblData.edit;
> dm.tblData['Jobno'] := iCurrJobno;
> end;
>
>
> There are probably other ways of doing this, but I would
> like to know why this does not work.
>
> Thanks Wallace
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz
> with Subject: unsubscribe
Laurie..
More information about the Delphi
mailing list