How to open .dbf (Convert from Delphi) lazarus / 3-General ---------------------------------------------------------------------- Jayndel · 2018-07-20 05:49 Hi all. Sorry if this isn't the correct way t ask, but after many years of db3+ -> Clipper > Delphi I am completely stumped. For 5 days I have tried to find the code to simply open a dbf file as follows PROCEDURE OpenPix ;   // BEGIN     Dir         := GetCurrentDir;     dbPix      := TTable.Create(nil)   ;     dbPix.TableType   := ttDBase   ;     dbPix.DatabaseName   := Dir   ;     dbPix.TableName   := 'Pix'   ;     dbPix.Exclusive      := True   ;     dbPix.Active   := True   ; End; I have looked everywhere, perhaps I'm too old to see the obvious, but I am really becoming desperate. Any help would be REALLY appreciated. ---------------------------------------------------------------------- Handoko · 2018-07-20 05:58 Hello Jayndel, Welcome to the forum. Here has a demo showing how to open a dbf, display the data on a StringGrid and doing searhing in the grid: https://forum.lazarus.freepascal.org/index.php/topic,37181.msg249361.h tml#msg249361 ---------------------------------------------------------------------- af0815 · 2018-07-20 07:50 The Code looks like using the Borland BDE. There is nothing equal in Lazarus. You can look in the Lazarus Wiki and search for dbf. Edit: http://wiki.freepascal.org/Lazarus_Tdbf_Tutorial see Code example: creating a table/DBF file The components in Lazarus works different if you use a desktop database like DBase. ---------------------------------------------------------------------- BrunoK · 2018-07-20 08:15 If you have Pix.DB and/or any Pix.MB, Pix.PX, Pix.XG0, Pix.YG0 etc... files then you probably have paradox table files. In that case you need to install the $(LazarusDir)\components\paradox\lazparadox.lpk package and include paradox.pp in the unit clause off your program. I think I remember having been able to read paradox tables this way but that's many years ago. ---------------------------------------------------------------------- af0815 · 2018-07-20 08:41 Quote from: BrunoK on July 20, 2018, 10:15:46 amIf you have Pix.DB and/or any Pix.MB, Pix.PX, Pix.XG0, Pix.YG0 etc... files then you probably have paradox table filesQuote from: Jayndel wrote: dbPix.TableType   := ttDBase  In BDE you must select the drivers and this says IMHO DBase (not ttParadox) see: http://docwiki.embarcadero.com/RADStudio/Tokyo/de/Tabellentyp_f%C 3%BCr_lokale_Tabellen_angeben ---------------------------------------------------------------------- Jayndel · 2018-07-20 19:41 The database I am trying to access is actually a dBase3. dbf. Unfortunately I have never previously used a visual database component, so I am rather lost. Thank you all for your assistance. While learning a new system at 75 years of age is not so easy, it is reassuring to find there is such an active community willing to assist. Again, many thanks. ---------------------------------------------------------------------- Zath · 2018-07-20 19:58 Open the table with a spreadsheet such as excel by selecting Open and select .dbf dBase as the file type. You can then save your data and use Lazarus to create a newer database program. ---------------------------------------------------------------------- Jayndel · 2018-07-20 23:47 Sorry about duplicate post, thought I had posted to incorrect section. I now find I had mis-named the problem. What I was trying to do was open a database in what was basically a console app. i.e. without using visual components I finally sorted the problem.. var   Form1: TForm1;   Dbf1: TDbf;   Dir   :    String;   n     :    Integer;                           Dbf1:=tDbf.Create(Self);   Dir:=GetCurrentDir;   Dbf1.FilePath := Dir;   Dbf1.TableLevel := 7;   Dbf1.Tablename := 'Games.dbf';   Dbf1.Exclusive := True;   Dbf1.Open;   n:=Dbf1.recordcount; // Proof of Success    Dbf1.Close  Many thanks for your help.