Databases lazarus / 16-Databases ---------------------------------------------------------------------- TonyR500 · 2020-06-22 15:57 A question concerning database applications I have to provide some enhancements to some Delphi applications which were written more than 20 years ago.I thought I would try to do this using Lazarus. The data tables in these applications are mainly dBase DBF files with (possibly) some Paradox files. Some of the applications use local dbf files i.e they are on one PC only. Now, I am new to Lazarus and my question is: - Using Lazarus can I connect Forms to local dBase dbf tables? and if so how do I do it? Which dataset and which datasource do I use? Any information regarding this would be useful. Many Thanks ---------------------------------------------------------------------- mig-31 · 2020-06-22 16:32 Hi, please read this wiki arctile https://wiki.freepascal.org/Lazarus_Tdbf_Tutorial. There are some limitations for DBF, Paradox and FoxPro db. You need to install DBFLaz package from your Lazarus installation. From Data Access pallete put into Form TDBF and Datasource components. Set the FilePath property of TDBF. Choose the TDBF in DataSet property from DataSource. Then from Data Control pallete put into Form for example TDBGrid compenent and set it DataSource property. I recommend your to convert your single user databases to something modern, for example SQLite or Firebird embeded. ---------------------------------------------------------------------- Zvoni · 2020-06-23 10:15 Quote from: mig-31 on June 22, 2020, 06:32:37 pmI recommend to your to convert your single user databases to something modern, for example SQLite or Firebird embeded. Seconded for SQLite! In case you need to "save/transfer" existing live-data, IIRC, you can open/import DBase-Files in Excel, then export it from there into CSV or whatever. ---------------------------------------------------------------------- xinyiman · 2020-06-23 10:19 I advise you to convert your project to Firebird. So in addition to using the SQL engine, you can make that data available to other clients in the future. ---------------------------------------------------------------------- Handoko · 2020-06-23 10:48 Using Lazarus to connect dbf tables is super easy, I ever wrote some programs using Lazarus - dbf. But just like others suggest, you should consider other better alternatives. Quick and easy, use dbf but for long time investment use the others. Database video tutorials: https://wiki.freepascal.org/Lazarus_videos#Database How to load dbf data (to a string grid), try this example: https://forum.lazarus.freepascal.org/index.php/topic,37181.msg249361.h tml#msg249361 Lazarus-supported databases: https://wiki.freepascal.org/Databases Lazarus database portal: https://wiki.freepascal.org/Portal:Databases ---------------------------------------------------------------------- wp · 2020-06-23 11:26 I agree with Handoko. Since you are new to Lazarus and want to convert old Delphi programs you'll have to fight enough with the differences. It does not make sense to change the database in the same step. So, stick with TDbf to get started. Later, when the Laz-Delphi conversion is done, you still can try to change the database. For reading Paradox you have two options: either use TParadox which comes with FPC (you must install the package (lazarus)/components/paradox/lazparadox.lpk) or TParadoxDataset (https://wiki.freepascal.org/TParadoxDataSet; install it via Online- Package-Manager). I was more successful with the latter one since it does not depend on any other library (unlike TParadox). Note, however, that it is only good for reading!