Recent

Author Topic: Coming from Delphi XE 3 and DBGrid - what to use?  (Read 2905 times)

Nicole

  • Hero Member
  • *****
  • Posts: 970
Coming from Delphi XE 3 and DBGrid - what to use?
« on: June 17, 2022, 10:48:37 am »
I have a Delphi application, which I think over to migrate to Lazarus.
There I used Delphi XE 3, Firebird and FireDAC. Well, it is old.

What I used excessivly is DBGrid. I comibned it with queries and calcEvents and a lot of stuff, which fields allow.
So rather complex.

What can I use if I migrate to Delphi?
Zeos looks great, but will it work as FireDAC? Firedac has a lot of tricks and block-reading and so on.
What about DBGrid? Somewhere I read "coming soon for Lazarus", which may mean, "wait some years".

Does anybody have hints or links or components for me?
Even the hint "forget it and mess on with the old thing" would be useful.

Thanks.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #1 on: June 17, 2022, 10:53:34 am »
Lazarus has a TDBGrid for a long time now, don't know where you got that.

As for database components, you have three choices, two that also work on Delphi:

- Lazarus/FPC's  own database components called fcl-db
- Zeos
- Since you use interbase/firebird: IBX

I don't know Firedac intimately as I already switched from Delphi native components to Zeos before it emerged.

Maybe before you start porting, just try to make a simple database in Lazarus?

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #2 on: June 17, 2022, 12:02:51 pm »
What I used excessivly is DBGrid. I comibned it with queries and calcEvents and a lot of stuff, which fields allow.
So rather complex.
DBGrid exists in Lazarus, but I do not know if everything you used is supported. Prepare for some work.

What can I use if I migrate to Delphi?
Zeos looks great, but will it work as FireDAC? Firedac has a lot of tricks and block-reading and so on.
Zeos and IBX exist for Delphi too, so they could be the easier path for you.

If I had to move a project like that to Lazarus, the quickest way would be to change Delphi project so that it has as much Lazarus compatible components as posible and have a working project in Delphi IDE first, and ONLY THEN use the convertor and continue further with compilation troubleshooting and manual adaption in Lazarus IDE.

Otherwise you might come to a position that you bite more then you can chew...
« Last Edit: June 17, 2022, 12:07:27 pm by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Nicole

  • Hero Member
  • *****
  • Posts: 970
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #3 on: June 17, 2022, 02:42:46 pm »
Thank you for the answers.

FireDac is - to my mind - inspirated by Embarcadero. And they worked with Borland's interbase.
So if Zeos is taken from Interbase, the both FireDac and Zeos may be cousins.

This migration of software gives me HUGE respect. I tried this conversion utility Delphi to Lazarus for forms and the success is near zero. It seems far away of converting even simple parts of components.

An endless story are the uses lists. They are rather long and about 80% or them is "unknown". Like system.forms and system.graphis and even buttons or so. There SHALL be a way different from mine, otherwise nearly nobody would migrate anything.

Is there a smart way for this endless uses-lists?

The information, that TBStringGrid / DBGrid would not exist now, is from here:
https://wiki.freepascal.org/LCL_Documentation_Roadmap

dseligo

  • Hero Member
  • *****
  • Posts: 1196
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #4 on: June 17, 2022, 03:04:40 pm »
The information, that TBStringGrid / DBGrid would not exist now, is from here:
https://wiki.freepascal.org/LCL_Documentation_Roadmap

That page is about documentation, not components:
Quote
This page is intended to keep track of the progress of the LCL documentation

miab3

  • Full Member
  • ***
  • Posts: 145
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #5 on: June 17, 2022, 03:51:36 pm »
FireDAC doesn't come from Embarcadero but from AnyDAC, and after being bought by Embarczdero it became a paid one and only in these more expensive versions of Delphi..
ZEOS is a free library and has been developed independently for many years as a library that works in both Delphi and Lazarus (identically),

Michał
« Last Edit: June 17, 2022, 04:06:03 pm by miab3 »

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #6 on: June 17, 2022, 04:49:16 pm »
@Nicole: chop it up in pieces. Don't try to compile the whole project in one go. A single included unit with a different name can generate a large amount of different errors.

Start with the low-level stuff. After that, most of your (support) classes work if you change {$mode ObjFPC} to {$mode Delphi}. Many commercial packages also have a Free Pascal / LCL build. That takes care of the core and business logic.

If there is a lot of logic in the forms, putting it in their own unit makes it much easier to debug. And cosmetic things you can comment out if they throw errors. At that point, you should have a working application with a bad GUI. You can try to fix it, or make a new one.

It looks bad at the start, but it is very rewarding as soon as you get the core logic running.

dsiders

  • Hero Member
  • *****
  • Posts: 1052
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #7 on: June 17, 2022, 05:22:36 pm »
The information, that TBStringGrid / DBGrid would not exist now, is from here:
https://wiki.freepascal.org/LCL_Documentation_Roadmap
That page is about documentation, not components:
Quote
This page is intended to keep track of the progress of the LCL documentation

The wiki page is outdated as well.

The most recent DBGrids documentation can be found at: https://dsiders.gitlab.io/lazdocsnext/lcl/dbgrids/index.html
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #8 on: June 19, 2022, 01:27:06 pm »
An endless story are the uses lists. They are rather long and about 80% or them is "unknown". Like system.forms and system.graphis and even buttons or so. There SHALL be a way different from mine, otherwise nearly nobody would migrate anything.

FPC and Lazarus don't use namespaced units as of now (despite the support being there), so for units provided by RTL, FCL and LCL you might get the most success by simply removing the System. or VCL. (in Delphi you can then set up the project that it supplies those by default).

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #9 on: June 19, 2022, 09:45:25 pm »
Thank you for the answers.

FireDac is - to my mind - inspirated by Embarcadero. And they worked with Borland's interbase.
So if Zeos is taken from Interbase, the both FireDac and Zeos may be cousins.

BDB, Dbexpress and FireDac in that order have been the generalized database packages from Embarcadero/Borland.

BDB was DBF and local database oriented (till about D6), DBexpress (D6 - DXE2/3) was more relational database and client server oriented.

I don't know FireDac that well, but one of the objectives was to both work with Firemonkey and VCL, and FireMonkey worked with a different way of databinding (more superficially C# like) called Live Bindings.

Most existing libraries orient themselves to dbexpress, and not FireDac. FPC/Lazarus does not support Firemonkey, not even the most basic work in that direction. Too much closed, and too hard to duplicate, and the same probably goes for firedac. (the VCL was originally a thin layer over WinAPI/GDI, making things more guessable)

Quote
The information, that TBStringGrid / DBGrid would not exist now, is from here:
https://wiki.freepascal.org/LCL_Documentation_Roadmap

That is a documentation roadmap, not a component exists roadmap.

As for the namespace issues, see Pascal Dragon's answer. It is annoying because for every new form, the Delphi designer keeps using dotted names and you have to strip them again (hence a tool for that would be nice), but it is currently the best way.

Nicole

  • Hero Member
  • *****
  • Posts: 970
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #10 on: June 24, 2022, 03:20:33 pm »
by the way:
Those "Livebindings", - I hated them so much. As well as Firemoneky.
This may be due to the fact, that they do not work well within XE 3.

Has this changed?
Did they become useful in Lazarus?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #11 on: June 24, 2022, 03:28:26 pm »
Has this changed?
Did they become useful in Lazarus?

I heard people say that livebindings are less bad in recent Delphi.  There are people that are really in favor of them, and people that are against them. I never used them, but the demonstrations I saw didn't sound too convincing.

As said, Lazarus doesn't support them, as we don't have  Firemonkey. Lazarus also uses VCL on non-windows.
  Maybe all the javascript backend stuff in the future might require a different binding kind, but that might not even be livebindings compatible.

In general, assume that anything connected to Firemonkey (either directly related to FM, or introduced because of FM (like livebindings and firedac) is not there in Lazarus)


PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Coming from Delphi XE 3 and DBGrid - what to use?
« Reply #12 on: June 25, 2022, 06:36:54 pm »
As said, Lazarus doesn't support them, as we don't have  Firemonkey. Lazarus also uses VCL on non-windows.

From what I saw when looking at LiveBindings, they're not specific to FireMonkey and can be used in VCL as well. (Though that doesn't change that Lazarus currently simply doesn't support them)

 

TinyPortal © 2005-2018