Lazarus DB Faq
This FAQ will be directed to database programming with Lazarus.
Where can I find more FAQ?
See the official website www.lazarus.freepascal.org. There is another FAQ as well. Here you will find a page that once started as a copy of the FAQ from www.lazarus.freepascal.org .
Where can I find database components?
At the moment the SQLdb components are part of the Lazarus package, you only need to install them. If you look in the [$LazarusDir]/components you will see a subdirectory SQLdb. Install the sqldblaz.lpk and you will be able to connect to MySQL, Interbase / Firebird and Postgres servers. Look here for help on installing packages.
Are there other components?
Yes. The ZEOS components have been ported to Lazarus as well.
You have to download ZEOSDBO_Rework from ZEOS cvs.
See also this tutorial for Zeos.
Pascal Data Objects works equally with Delphi and FPC 2.0
IB / FB
How do I connect from Linux to a Windows server
Entering the correct path to a database on a Windows server from a Linux client is not very clear.
Say you have installed firebird in F:\Program Files\firebird\. The employee.fdb example database will then be installed in the directory F:\Program Files\firebird\examples\ . The IP-adress of your computer is 192.168.2.100.
Then entering the following databasename
in your IBConnection will connect to the required database.
Note that you don't have to enter a value for the hostname property!
Which version of mySQL is supported?
Currently MySQL 4.0, MySQL 4.1 and MySQL 5.0 are supported by de SQLdb components. Make sure you are using the correct connection component for your client library version. So if you have the client libraries installed for MySQL 4.1 then you have to use TMySQL41Connection component, even if the server is running version 4.0 or 5.0.
Pascal Data Objects
There is now an alternative. The functions introduced with MySQL 4.1 and 5.0 like prepared statements, binding, and stored procedures are supported by database API called Pascal Data Objects, which is inspired by PHP Data Objects. All the code and documentation necessary to use this new API is available on a Trac wiki:
https://trac.synsport.com:8000/index.php/pdo/wiki (username/password is guest/guest)
--Jrmarino 11:28, 13 Mar 2006 (CET)