[SOLVED] Paradox, anyone using this writting an app or know? lazarus / 16-Databases ---------------------------------------------------------------------- 1HuntnMan · 2023-10-10 17:41 Hello All, I'm new to Lazarus but not pascal. In my younger years programmed a lot of apps for small to medium sized companies. Started out with Clipper, then moved to Delphi 5 and then Delphi 7. When I quit Clipper and moved to Delphi I also started designing these small business system using a Paradox database which was supported back then by Borland's Delphi.  Just curious, I saw a screen shot of Lazarus on a website that had the Paradox component but it's not in my Lazarus install. Since I'm new to Lazarus and writing a single user system, not more than 3 people using it at the same time I foresee, I don't see the need to start out with SQLite or Firebird because I don't have any experience with either and would have to go thru a learning curve. I've started developing with TDbf but have all these Delphi apps that were designed with Paradox databases. Thanks, Donald aka 1HuntnMan ---------------------------------------------------------------------- Handoko · 2023-10-10 18:07 I tried Lazarus + Paradox long ago. It was working good, I had no complaint about it. But it seemed to me TDBF was better maintained so I abandoned Paradox and used TDBF. I now learning and using Firebird. If you can use TDBF, learning Firebird or other SQL-based databases isn't hard. The main reason I abandoned TDBF is a potential license issue, read more here: https://forum.lazarus.freepascal.org/index.php/topic,60100.msg448769.h tml#msg448769 To enable LazParadox in your Lazarus: Lazarus main menu > Package > Install/Uninstal Packages > on the right panel, search for: lazparadox 0.0 > Instal selection > Save and rebuild IDE > wait until the Lazarus restart To install TParadoxDataset in your Lazarus: Lazarus main menu > Package > Online Package Manager > search for: TParadoxDataset > Click the checkbox > Install > follow the instruction until finished ---------------------------------------------------------------------- wp · 2023-10-10 18:14 Quote from: Handoko on October 10, 2023, 08:07:31 pmTo enable LazParadox in your Lazarus: Lazarus main menu > Package > Install/Uninstal Packages > on the right panel, search for: lazparadox 0.0 > Instal selection > Save and rebuild IDE > wait until the Lazarus restart Be prepared for problems: the paradox package coming with Lazarus requires the pxlib.dll accessible by the IDE, and this dll - AFAIK - exists only for 32 bit. If these conditions are not met your IDE will not start any more! Quote from: Handoko on October 10, 2023, 08:07:31 pmTo install TParadoxDataset in your Lazarus: Lazarus main menu > Package > Online Package Manager > search for: TParadoxDataset > Click the checkbox > Install > follow the instruction until finished That's better, but only for reading... ---------------------------------------------------------------------- Handoko · 2023-10-10 18:17 Quote from: wp on October 10, 2023, 08:14:26 pmBe prepared for problems: the paradox package coming with Lazarus requires the pxlib.dll accessible by the IDE, and this dll - AFAIK - exists only for 32 bit. As I said long ago. That was when I was using WinXP, which means 32-bit. ---------------------------------------------------------------------- korba812 · 2023-10-10 20:47 If you are not planning to convert a Paradox database to something more widely supported then my advice is to stay with Delphi. Delphi supports Paradox through BDE, so you can use SQL and QBE queries. The pxlib library provides only basic access to the database files, provides only basic index support and does not support SQL queries. ---------------------------------------------------------------------- TNesler · 2024-01-07 01:41 Would it make more sense to convert your Paradox files to DBase Files?  Is DBase supported better in Lazarus/FPC?  I ask because I too am starting to use Lazarus from Dephi and have existing programs I want to convert. ---------------------------------------------------------------------- cdbc · 2024-01-07 09:35 Hi If you're gonna convert, then go the extra mile and convert to SQLite3 right away, makes much more sense  Then you'll be in "Sql-Country" and the step towards multi-user sql- engines is much smaller  Regards Benny ---------------------------------------------------------------------- Thaddy · 2024-01-07 10:31 There is Paradox support as mentioned, but it is merely to convert to other, more better supported and SQL capable formats. The same goes for DBF support. There is, pretty good, support for both formats, to be able to convert it to something more modern. I still have to use Paradox and DBF format, but only to convert to a more modern format. Don't use both formats for new development. EVER! (Hurts me a bit because I wrote some Paradox and DBF compatible engines back in the days, but both formats have passed their sell-by date) ---------------------------------------------------------------------- egsuh · 2024-01-08 04:32 If SQL feature is not necessary, I think TSQLiteDataSet or something will provide similar functionalities with BDE-paradox. Doesn't it? So, moving to SQLite is recommended, I think. ---------------------------------------------------------------------- MarkMLl · 2024-01-08 08:05 Quote from: Thaddy on January 07, 2024, 11:31:54 amDon't use both formats for new development. EVER! Thaddy, in the interest of getting an unambiguous point over to OP, do you mean "Don't ever use Paradox, and don't ever use DBF!" or "Don't try to use both at the same time!". My own opinion is that both are true, and frankly I'd lean towards the first- stronger- interpretation. MarkMLl ---------------------------------------------------------------------- Thaddy · 2024-01-08 09:08 What I mean is don't ever use Paradox or dbf format (any dbf format) for new projects and use the Paradox or DBF support from Freepascal to port your applications to a better supported and current format. So don't use legacy. There is one  exception: maintenance of an older application may be an acceptabele reason. My advice for newer formats would be either Progress or MariaDb/MySql for complex multi-user programs or Sqlite for single user. (Don't use firestarter or whatever it is called) ---------------------------------------------------------------------- MarkMLl · 2024-01-08 09:55 Thanks for that, I agree. In particular, I've seen people trying (with various degrees of success) to use Paradox multi-user for decades: bad idea. /Very/ bad idea, allowing for the ready availability of proper client-server databases from the early 00s onwards. I think you mean Firebird, but the name does appear to vary a bit. The major problem I had with that when I looked (admittedly, some years ago) was documentation: essential information spread over too many manuals and errata. OTOH, with the exception of e.g. role creation its syntax was usefully compatible with PostgreSQL: fairly easy to write a program which could use either. MarkMLl p.s. What's "progress"? ---------------------------------------------------------------------- Zvoni · 2024-01-08 10:09 Quote from: MarkMLl on January 08, 2024, 10:55:15 amp.s. What's "progress"? No idea if it's just a Typo of Thaddy (maybe he meant PostGres), but "Progress" actually is a RDBMS https://www.progress.com/openedge ---------------------------------------------------------------------- Thaddy · 2024-01-08 10:26 https://www.postgresql.org/ One of the most used and capable open source  SQL database ---------------------------------------------------------------------- MarkMLl · 2024-01-08 10:32 Quote from: Thaddy on January 08, 2024, 11:26:22 amhttps://www.postgresql.org/ One of the most used and capable open source  SQL database Yes, and which I've been using for 20+ years. I though that was probably what you meant, but particularly when a relative newcomer is asking for advice I think it behooves everybody to try to be unambiguous. MarkMLl ---------------------------------------------------------------------- wp · 2024-01-08 11:14 Basically the objections against dbf are correct. But it has one main advantage: It has no other dependencies, it is pure Pascal, no missing dlls, no 32bit/64 bit issues. Therefore, I'd prefer dbase for small projects over "monsters" such as postgresql, firebird, or even sqlite3. ---------------------------------------------------------------------- MarkMLl · 2024-01-08 13:20 I think that's reasonable, provided that the developer is sufficiently well-informed- and TBH mature- that he can recognise that there's virtually no latitude for piling features on top. I chose PostgreSQL specifically because I was dealing with large, non- restartable data collection sessions: if something went wrong you had to rewind the transaction and redo in its entirety. And nothing else I could find at the time was both easily accessible (i.e. you didn't need to buy a ten-person license to support ten telemetry modems) and had a robust transaction facility. ----- Which leads me on to a cautionary tale, inspired by something in today's news. From the 1980s onwards, large parts of the UK's state-supported computer company ICL were sold off to Fujitsu. Now ICL had long been mandated for academic and government-related business (although this was regularly waived), and as far as I can see this continued for a while despite the fact that the entire "brand" was now Fujitsu. The result of which was that when a contract came up for "computerizing" the country's sub-postoffices (basically franchisees with a special counter in their corner shop) Fujitsu got it: it's now known as Horizon. The result apparently worked fine when tested by the developers. Unfortunately, when used in the Real World it turned out that if a modem session dropped accounting records would disappear leaving the subpostmaster with a deficit which was his responsibility: around 700 were convicted of fraud. With a nod to an earlier thread ** , it is quite clear that that was a transaction issue. But it ruined 700 families: some of the people concerned are now dead, and almost all found themselves vilified by their communities. ** https://forum.lazarus.freepascal.org/index.php/topic,63982.msg48750 1.html#msg487501 QuoteThere might be ways of recovering from this and reestablishing the connection, even if the client IP address changes, but I have seen no coherent discussion of this. In any event, this would be unable to reinstate the state of the failed transaction, with the result that the content of the table (on the server) and DB-aware visual controls (on the client) would have to be assumed to be inconsistent. MarkMLl ---------------------------------------------------------------------- egsuh · 2024-01-09 08:11 QuoteBasically the objections against dbf are correct. But it has one main advantage: It has no other dependencies, it is pure Pascal, no missing dlls, no 32bit/64 bit issues. Therefore, I'd prefer dbase for small projects over "monsters" such as postgresql, firebird, or even sqlite3. How can I use this? More exactly, how can I create dbf files?  I cannot create .dbf file from within Lazarus itself. I found DBF Viewer and it says it can create dbf file, but it does not seem free.  Any other way? ---------------------------------------------------------------------- Zvoni · 2024-01-09 08:41 Quote from: egsuh on January 09, 2024, 09:11:00 amHow can I use this? More exactly, how can I create dbf files?  I cannot create .dbf file from within Lazarus itself. I found DBF Viewer and it says it can create dbf file, but it does not seem free.  Any other way? https://dbeaver.io/about/ EDIT Quote Any other way?OpenOffice/LibreOffice Calc can export to DBF. Design your table there, and export...? No Idea about table-Levels ---------------------------------------------------------------------- dseligo · 2024-01-09 08:42 Quote from: egsuh on January 09, 2024, 09:11:00 amQuoteBasically the objections against dbf are correct. But it has one main advantage: It has no other dependencies, it is pure Pascal, no missing dlls, no 32bit/64 bit issues. Therefore, I'd prefer dbase for small projects over "monsters" such as postgresql, firebird, or even sqlite3. How can I use this? More exactly, how can I create dbf files?  I cannot create .dbf file from within Lazarus itself. I found DBF Viewer and it says it can create dbf file, but it does not seem free.  Any other way? Open google. Type: lazarus dbf Click on first result. ---------------------------------------------------------------------- Thaddy · 2024-01-09 12:25 For both dBase and Paradox there exist odbc drivers. You can use that too. ---------------------------------------------------------------------- MarkMLl · 2024-01-09 12:48 Quote from: Thaddy on January 09, 2024, 01:25:24 pmFor both dBase and Paradox there exist odbc drivers. You can use that too. Agreed, and since I like standards that would normally be my first choice. /However/, if you do that you will find yourself in deep trouble if one or more database implementations gains some "must have" facility which is slow getting into the ODBC standard. In my case I had two layers of problem when this happened: a Delphi- built suite on top of BDE on top of ODBC, which would have benefited enormously from being able to get at the backend server's asynchronous notification facility. It turned out to be virtually impossible to do this with BDE and ODBC in the way: the relevant handles were buried too deeply. But when I started exploring the situation with FPC and the LCL I had very little difficulty, and that was years before there were components for (PostgreSQL and Firebird) async notifications. So while this might not apply to other development environments, in the case of FPC etc. I'm entirely happy with the abstraction presented by the RTL/FCL. Now I admit that when I was looking at session robustness recently I did have to add one file https://github.com/MarkMLl/testdb/blob/main/pqconnection2.pas in order to expose properties (port numbers etc.) presented by the underlying backend library, but doing this would have been vastly more difficult had there been additional layers in the way. MarkMLl ---------------------------------------------------------------------- egsuh · 2024-01-10 06:35 Quotehttps://dbeaver.io/about/ DBeaver says it supports DBF, but I cannot create new table there. Anyway I do not definitely need to use dBase, but having another option could be helpful in some cases. Right now, I have to be satified with opening dbase files. ---------------------------------------------------------------------- cdbc · 2024-01-10 08:06 Hi Use the "TDbf" component that comes with lazarus... Regards Benny ---------------------------------------------------------------------- Thaddy · 2024-01-10 08:55 Quote from: cdbc on January 10, 2024, 09:06:26 amHi Use the "TDbf" component that comes with lazarus... Regards Benny Yes, and TDbf can actually create tables and indices. I am not sure the Paradox native component can do that. I used Paradox only around the year 2000 and quickly left using it. Note that for dBase, the "database" is merely a directory that contains the tables. Brings back fond memories about working on PerfectView, used dbf format, with initially proprietary indexing. ---------------------------------------------------------------------- avra · 2024-01-11 19:55 If you really, really have to use DBF or Paradox, then you have to make special care if you also want to use indexes because they can get easily corrupted on unexpected application shutdown. Back in the old Clipper/dBase/FoxPro days, the last command on app exit was to create zero length like as a flag that application had a regular exit and not power outage. If on app start you find this file then you delete it and proceed startup as normal, but if file did not exist then it meant that there was a high chance that your indexes were corrupted so you reindex your data with some progress indicator displayed to user. I really recommend that if you want to create a single user application you take a look at sqlite, and for multi user postgresql. There are many other nice options but with these you can't go wrong. ---------------------------------------------------------------------- Zvoni · 2024-01-12 07:08 Quote from: avra on January 11, 2024, 08:55:31 pmI really recommend that if you want to create a single user application you take a look at sqlite, and for multi user postgresql. There are many other nice options but with these you can't go wrong. Nevermind SQL-Support ---------------------------------------------------------------------- Thaddy · 2024-01-12 12:18 Quote from: avra on January 11, 2024, 08:55:31 pmClipperHorror, can't sleep tonight. I was forced to work with it for six months until I got fed up and quit my job. My in-depth knowledge of dBase did not help with all those quirks. So I had to tell my employers I actually failed (NOT entirely) and quit on the spot. If your conscience tells you you are less productive, quit. Yet another different index format that does not do what you expect. (Although it was pretty good at building DOS user interfaces.) I am still convinced that the developers of clipper had no real basis in computer science at all. ---------------------------------------------------------------------- avra · 2024-01-12 15:22 Quote from: Thaddy on January 12, 2024, 01:18:13 pmQuote from: avra on January 11, 2024, 08:55:31 pmClipperHorror, can't sleep tonight.Hahahaaaa, I fully understand you. FoxPro was much better, and it even had primitive but slow SQL support. The only thing worse then Clipper was dbMAN on Atari ST and Amiga running app from a single bootable diskette. Learned the reindexing trick the hard way. I was so happy when those days have passed. ---------------------------------------------------------------------- MarkMLl · 2024-01-12 21:34 Quote from: Thaddy on January 12, 2024, 01:18:13 pmI am still convinced that the developers of clipper had no real basis in computer science at all. In fairness: when Clipper came out, who had? And if they had, how much useful "Real World" experience had they had time to develop after graduating? And for that matter, how much basis in Computer Science (as now understood) did SQL have? It obviously had a basis in Codd's ideas (dressed up using fancy terms like "algebra" and "calculus"), but when it was standardised (mostly by IBM) such things were novel and untaught. There were relatively few people in the early '70s who made any serious attempt to apply theoretical rigour to computing. The outstanding exception to that was Dijkstra, and his opinion of IBM was unprintable. But the people who worked on Clipper and the rest /did/ have some measure of grounding in commerce, which was probably more useful: I dread to think what would have happened if somebody had attempted to apply any sort of rigorous CS-theoretical approach to the job of building a user interface with a data-handling backend on a '286 computer running DOS. MarkMLl