Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-11

Editing a TDBf record

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Dave Coventry

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
   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' "

Reply by email

Luiz Americo Pereira Camara
to Dave Coventry
Dave Coventry wrote 11 lines
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

Show quoted text 24 lines
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 http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Dave Coventry
to Luiz Americo Pereira Camara

That's great, thank you Luiz: works a treat!

TDbf is such a nice lightweight solution for incorporating database functionality into monolithic applications and it's still relevant even though it appears that development stopped years ago.

2008/11/30 Luiz Americo Pereira Camara :

Show quoted text 43 lines
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 > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > > > _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Marco van de Voort
to Dave Coventry
Dave Coventry wrote 5 lines
That's great, thank you Luiz: works a treat! TDbf is such a nice lightweight solution for incorporating database functionality into monolithic applications and it's still relevant even though it appears that development stopped years ago.

Afaik Micha still fixes bugs.

Reply by email

Micha Nelissen
to Marco van de Voort
Marco van de Voort wrote 8 lines
On Sun, Nov 30, 2008 at 09:08:13AM +0200, Dave Coventry wrote: > That's great, thank you Luiz: works a treat! > > TDbf is such a nice lightweight solution for incorporating database > functionality into monolithic applications and it's still relevant > even though it appears that development stopped years ago. Afaik Micha still fixes bugs.

Well, for some reason I have gotten unsubscribed from the sourceforge tdbf forum, and I didn't monitor it anymore. Now I see some other people are trying to troubleshoot some problems for others.

I am not actively using it myself, and so I thought nobody else was using it any longer also, with all the mysql / sqlite / firebird etc around ;-).

Micha

Reply by email