[Lazarus] Fwd: The results of your email commands
ArĂ Ricardo Ody
ari.ody at japinfo.com.br
Tue Apr 15 16:13:57 CEST 2008
Felipe Monteiro de Carvalho wrote:
> Thanks, but how did you create the dbf file for the example?
>
Pretty easy... :-)
uses
dbf, dbf_fields;
constructor TMainForm.Create(AOwner: TComponent);
var
fields: TDbfFieldDefs;
begin
inherited Create(AOwner);
DataSet := TDBF.Create(Self);
DataSet.TableName := 'temp.dbf';
fields := TDbfFieldDefs.Create(self);
fields.Add('Name', ftString, 50);
fields.Add('Address', ftString, 150);
DataSet.CreateTableEx(fields); // <== Now we have a empty database
DataSet.Open;
Dataset.Insert; // <== start inserting data
Dataset.FieldByName('Name').AsString := 'Graeme';
Dataset.FieldByName('Address').AsString := 'graemeg at nospam.co.za';
DataSet.Post;
....
end;
Regards,
- Graeme -
_______________________________________________________
fpGUI - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/
More information about the Lazarus
mailing list