Recent

Author Topic: dBase in Lazarus  (Read 1855 times)

iret

  • New Member
  • *
  • Posts: 10
Re: dBase in Lazarus
« Reply #30 on: September 16, 2022, 03:31:54 pm »
Hello,

thanks for all the people that tried to help with my TDbf problems.
Here's a short of my current findings for anybody also struggling with dbase files:

  • My project is now working for 4 weeks without major issues (fingers crossed)
  • Although it is working, I would never recommend to use dbase files in any new development
  • TDbf from the fpc repositories has issues with index files, the version at sourceforge contains fixes for those

        ==> Use TDbf from https://sourceforge.net/p/tdbf/code/HEAD/tree/trunk/)
        @WP: Thanks a lot for your tip, this was my breakthrough
  • The documentation of TDbf (s. sourceforge) clearly states that "locking" should work and interoperability with BDE is also a goal  of the project
  • I suspect another index bug in TDbf, concerning indices on an integer column. It's too early to file a bug report but I will investigate some more time on this topic.

For those of you still wondering why I'm working with dbase files in this project:
  • The original project started back in the 90's on a Novell server with DOS clients
  • The software is vital for production: It manages the work of 8 different cable cutting machines and also has an interface to the ERP software and different proprietary industrial printers
  • Replacing the system with another database solution would mean approx. >500 working hours, including the risk of production failure
  • We are currently integrating a new machine and taking the opportunity to slowly prepare the software for a new database environment.
   
Bets regards


avra

  • Hero Member
  • *****
  • Posts: 2368
    • Additional info
Re: dBase in Lazarus
« Reply #31 on: September 16, 2022, 06:26:17 pm »
When I made single user single instance Delphi applications using dbase files long time ago, in app initialization I checked if last exit from application was regular, and if it wasn't I recreated indexes. Check was very simple - create file on app start, delete it on app exit, and on app start recreate indexes if file existed. That solved many dbase problems I faced and app was running well for at least 15 years.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

rvk

  • Hero Member
  • *****
  • Posts: 4948
Re: dBase in Lazarus
« Reply #32 on: September 16, 2022, 06:29:40 pm »
When I made single user single instance Delphi applications using dbase files long time ago, in app initialization I checked if last exit from application was regular, and if it wasn't I recreated indexes.
Hard to do in a multi user environment where there are also BDE programs accessing the same database at the same time (like the case is with TS).

Arioch

  • Sr. Member
  • ****
  • Posts: 384
Re: dBase in Lazarus
« Reply #33 on: September 16, 2022, 07:59:09 pm »
when i was doing DBF in Delphi 5 - i remember Torry Pages had VKDBF library too

all in all i ended with TDbf and even made some patches to it back then, but VK DBF was close second

additionally, back then there was a rather well-known product, Database Advantage, building an SQL layer on top of DBF files, whic his similar to what BDE LocalSQL was provided but allegedly more advanced

Arioch

  • Sr. Member
  • ****
  • Posts: 384
Re: dBase in Lazarus
« Reply #34 on: September 16, 2022, 08:02:35 pm »
Hard to do in a multi user environment where there are also BDE programs accessing the same database at the same time (like the case is with TS).

BDE...

there can be also Mcirosoft Excel, and Microsoft Acccess and Microsoft FoxBase/FoxPro

and they support different flavours of DBF (like, excel was using DBF version 3 while ODBC FoxPro driver used DBF version 5, and those formats had different ways to specify Russian language and differnt charsets for Russian...). And probably different locking semantics too

Really, when it goes above write-copye-consume, but about continuous behavior, you'd better stick to some library...  Can you just call BDE functions from Lazarus instead?

 

TinyPortal © 2005-2018