Recent

Author Topic: Access MSSQL with Lazarus  (Read 670 times)

claytonocn

  • Newbie
  • Posts: 2
Access MSSQL with Lazarus
« on: September 19, 2024, 09:05:29 pm »
Hello!
I am a Delphi programmer and would like to migrate to Lazarus. I usually access MSSQL databases via ADO, using the components from the dbGO palette.

I would like to know which component to use in Lazarus that allows me to connect to the server without having to install or configure anything on the client PC, as I already do in Delphi.

Also, which component has the best performance and which components are compatible for compiling for Windows, Linux and Mac?

Thank you!

Zvoni

  • Hero Member
  • *****
  • Posts: 2692
Re: Access MSSQL with Lazarus
« Reply #1 on: September 20, 2024, 08:11:44 am »
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

luca

  • Jr. Member
  • **
  • Posts: 84
Re: Access MSSQL with Lazarus
« Reply #2 on: September 20, 2024, 09:55:00 am »
Hi.
I'm using ODBC connector (TODBCConnection).
It gives the possibility to use the last ODBC driver version to connect to SQL Server and it's portable.
You can configure the connection by using an external DSN file.

In my project I started using MSSQL 2000 migrated recently to MSSQL 2022.

Best Regards

af0815

  • Hero Member
  • *****
  • Posts: 1369
Re: Access MSSQL with Lazarus
« Reply #3 on: September 21, 2024, 06:33:16 pm »
As a Delphi developer, you can change to zeros, Wich is available for Delphi and Lazarus. After the Changes in Delphi, the change to Lazarus will be one point easier.
regards
Andreas

dseligo

  • Hero Member
  • *****
  • Posts: 1372
Re: Access MSSQL with Lazarus
« Reply #4 on: September 21, 2024, 09:17:36 pm »

af0815

  • Hero Member
  • *****
  • Posts: 1369
Re: Access MSSQL with Lazarus
« Reply #5 on: September 23, 2024, 07:58:34 am »
zeros

You mean ZEOS (https://wiki.freepascal.org/ZeosDBO), not zeros?
YES. It one of the easiest way to start a convertion, because you can try to start in Delphi and work later in Lazarus with Zeos. Because the ceaveats are normal the other used components, you have to figth against. If you use third party componnets without source and no support for freepascal you have to do a very hard way, to solve the situation. Often it is better to rewrite the software and use only codeparts of the 'old' application. This is IMHO sometimes easier and faster. Depending on the old code.
« Last Edit: September 23, 2024, 08:02:57 am by af0815 »
regards
Andreas

nummer8

  • Full Member
  • ***
  • Posts: 115
Re: Access MSSQL with Lazarus
« Reply #6 on: September 23, 2024, 10:58:14 am »
Recently I had to connect to a MSSQL database.
I started with ZEOS components icm with dblib.dll

https://downloads.freepascal.org/fpc/contrib/windows/

At first I used the ADO protocol but had problems with statement timeouts.
As a second atttempt I used oleDB protocol which had a variation in the connectionstring. But no problems if the statemanet took longer to produce a result.
So my advise would also be ZEOS.

 

TinyPortal © 2005-2018