Forum > General

How to open .dbf (Convert from Delphi) <SOLVED>

(1/2) > >>

Jayndel:
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 ;   // <Delphi Code>
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:
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.html#msg249361

af0815:
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:
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:

--- Quote from: BrunoK on July 20, 2018, 10:15:46 am ---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
--- End quote ---

--- Quote from: Jayndel --- wrote: dbPix.TableType   := ttDBase 
--- End quote ---
In BDE you must select the drivers and this says IMHO DBase (not ttParadox)

see: http://docwiki.embarcadero.com/RADStudio/Tokyo/de/Tabellentyp_f%C3%BCr_lokale_Tabellen_angeben

Navigation

[0] Message Index

[#] Next page

Go to full version