Difference between revisions of "Lazarus DB Faq"

From Lazarus wiki
(Started linking to individual pages to remove duplicate content and make it clearer where to find things)
(Refer to content pages of various dbs)
Line 24: Line 24:
== MySQL ==
== MySQL ==
* Please see [[mysql]]
* Please see [[mysql]]
==== 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 sourceforge:
Jan 30, 2007: PDO has added drivers for Firebird 1.5 and 2.0
== PostgreSQL ==
== PostgreSQL ==
* Please see [[postgresaql]]
You can connect to PostgreSQL db by TPQConnection component. This component uses the PostgreSQL's libpq connection library [http://www.postgresql.org/docs/8.0/interactive/libpq.html], so you can easily connect almost every PostgreSQL db, but the component doesn't support the following connection options:
== SQLite ==
* Port
* Please see [[sqlite]]
* ClientEncoding
Maybe there are other unsupported connection parameters.
The TPQConnection component does not directly support a Port property, but one can pass the port into the component via the Params parameter:
<syntaxhighlight>PQConnection.Params.Add('port=' + VariableContainingPort);</syntaxhighlight>
Also other connection parameters can be specified using Params property:
== See also ==
== See also ==

Revision as of 09:44, 14 September 2012

Deutsch (de) English (en) español (es) français (fr) italiano (it) 日本語 (ja) português (pt) русский (ru) slovenčina (sk) 中文(中国大陆)‎ (zh_CN)


This FAQ covers database programming with Lazarus.

Where can I find more FAQ?

See Lazarus Faq. See also the official website [1].

Where can I find database components?

At the moment the SQLdb components are part of FPC and Lazarus. They are installed by default in all more or less recent Lazarus versions. Manual installation: 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, Postgres, MS SQL and Sybase ASE (if you have FPC 2.6.1+), Oracle servers. See Install Packages for help on installing packages.

Are there other components?





See also