[Lazarus] Editing a TDBf record
Luiz Americo Pereira Camara
luizmed at oi.com.br
Sun Nov 30 00:17:00 CET 2008
Dave Coventry escreveu:
> Does anyone have experience of TDbf?
>
> I want to change an existing record:
>
> ival:=strtoint(ConFigs.Values['hubID']);
> Dbf1.Open;
> while not(Dbf1.EOF)do
> begin
> if Dbf1.FieldByName('hubID').AsInteger=ival then
> begin
>
Add "Dbf1.Edit;" here
> Dbf1.FieldByName('Loc').AsString:=Configs.Values['Location'];
> Dbf1.FieldByName('EstName').AsString:=Configs.Values['Establishment'];
> Dbf1.FieldByName('NetwkName').AsString:=NetwkName;
> Dbf1.FieldByName('VATNo').AsString:=Configs.Values['VATNumber'];
> Dbf1.FieldByName('TelNo').AsString:=Configs.Values['TelNumber'];
> Dbf1.FieldByName('User').AsString:=username;
> Dbf1.Post;
> end;
> Dbf1.Next;
> end;
>
> Obviously ival has the value of the 'hubID' field of the record that I
> want to update and I'd like to replace all the fields in the record
> with new values.
>
> However, I'm getting an error which says: "Project raised exception
> class 'Unknown' "
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
>
More information about the Lazarus
mailing list