TDBF replacemen ? lazarus / 16-Databases ---------------------------------------------------------------------- DelFly · 2013-08-01 19:21 Just figure out , with help from some of my old delphi code how to use database in lazarus and create fields. GREAT !!  but now its giveing the warning that Tdbf is deprecated. oww.  Now the question, whats the replacement for Tdbf thats working the same with database creation. As example i create it now this way, i dont look for linux compatibility. procedure TForm1.Button1Click(Sender: TObject); begin   With Dbf1 do   Try     Active := False;     Filepath:=ProgramPath+DataDir+'\';     //Databasename:=DBfile+DBExt;     TableName := DBfile;     with FieldDefs do     begin       Clear;       Add('1' , ftFixedChar    , 20, False);       Add('2' , ftFixedChar    , 20, False);       Add('3' , ftFixedChar , 60, False);     end;     CreateTable;     Active := True;   Except     { If an error occurs, the table is corrupt - create a new one }     on EDatabaseError do     begin     end;   end; end; ---------------------------------------------------------------------- BigChimp · 2013-08-01 19:34 Quote from: DelFly on August 01, 2013, 09:21:03 pmJust figure out , with help from some of my old delphi code how to use database in lazarus and create fields. GREAT !!  but now its giveing the warning that Tdbf is deprecated. oww.  Now the question, whats the replacement for Tdbf thats working the same with database creation. The replacement is TDBF. We're maintaining TDBF again, see http://wiki.lazarus.freepascal.org/User_Changes_Trunk#TDBF_unit_deprec ation_removed If you run into problems, post on the forum and I'll have a look to see if it can be fixed. Edit: wiki tutorial/article with links to docs etc: http://wiki.lazarus.freepascal.org/Lazarus_Tdbf_Tutorial PS: Alternatives are sqlite or embedded firebird; both can be run with the standard Lazarus/FPC SQLDB database components; both are cross platform. Of course, TDBF is native while you'd need driver .dll/.so libs for the others. ---------------------------------------------------------------------- DelFly · 2013-08-01 19:42 Ok, thanks. Tdbf is what im useing. but still saw the deprecated warning. but it can be some unit that gave the error to. it seems now fine. I love lazarus, and the old delphi 5 gui is no problem anymore to. it feels ok. ---------------------------------------------------------------------- BigChimp · 2013-08-01 20:07 Quote from: DelFly on August 01, 2013, 09:42:35 pmTdbf is what im useing. but still saw the deprecated warning. but it can be some unit that gave the error to. it seems now fine. TDBF has the deprecated warning in FPC 2.6.0 and 2.6.2, which are used with Lazarus 1.0.x These versions have been released as stable versions and cannot be modified later on once they have been released, so the deprecation warning still remains in them (but is deceiving in this case). The warning has been removed in FPC trunk/2.7.1/development version. If there are critical problems in FPC 2.6.2 code, we'll try and backport a fix from FPC trunk to a 2.6.x maintenance release. ---------------------------------------------------------------------- marcov · 2013-08-02 09:43 Quote from: BigChimp on August 01, 2013, 10:07:34 pm The warning has been removed in FPC trunk/2.7.1/development version. (and the fixes branch.  the 2.6.4 release cycle will probably start in september)