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)
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{Lazarus DB Faq}}
 
{{Lazarus DB Faq}}
  
== General ==
+
{{Infobox databases}}
  
This FAQ covers database programming with Lazarus.
+
This is a list of Frequently Asked Questions (FAQ) regarding database programming with Lazarus.
  
=== Where can I find more FAQ? ===
+
=== Where can I find more information? ===
 
+
Databases:
See [[Lazarus Faq]]. See also the official website [http://www.lazarus.freepascal.org].
+
* See [[Databases]] and the articles about using databases/SQLQuery.
  
 
=== Where can I find database components? ===
 
=== 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.
  
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.
 
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.
 
See [[Install Packages]] for help on installing packages.
  
=== Are there other components? ===
+
=== Supported databases ===
* See [[Lazarus_Database_Tutorial]] for a list of what databases work with what components.
+
* See [[Lazarus Database Overview]] for a list of what databases are supported by SQLDB.
  
== IB / FB ==
+
=== Known issues ===
* Please see [[Firebird_in_action]]
+
* See [[fcl-db#Known%20issues/shortcomings]]
  
 +
=== Are there other components? ===
 +
* See [[Lazarus Database Overview]] for a list of what databases work with what components.
  
== MySQL ==
+
=== Lazarus and FPC documentation ===
* Please see [[mysql]]
+
The Lazarus visual database controls use FPC database code. Please see [http://www.freepascal.org/docs-html/fcl/sqldb/index.html SQLDB documentation] for more information.
 
 
 
 
==== 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:
 
 
 
http://pdo.sourceforge.net
 
 
 
Jan 30, 2007: PDO has added drivers for Firebird 1.5 and 2.0
 
 
 
== PostgreSQL ==
 
 
 
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:
 
* Port
 
* 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:
+
Background info on SQLDB: [[SqlDBHowto]]
<syntaxhighlight>PQConnection.Params.Add('application_name=''yourappname''')</syntaxhighlight>
 
  
== See also ==
+
More info on TSQLQuery: [[Working With TSQLQuery]]
  
* [[Databases]]
+
=== Lazarus documentation ===
* [[Lazarus_Database_Tutorial]]
+
* Some information on the interaction between the various FPC and Lazarus components: [[SQLdb Programming Reference]]
  
 
[[Category:Databases]]
 
[[Category:Databases]]
[[Category:FAQ]]
 
 
[[Category:FPC]]
 
[[Category:FPC]]
 
[[Category:Lazarus]]
 
[[Category:Lazarus]]
 +
[[Category:FAQs]]

Latest revision as of 11:59, 15 August 2016

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

Databases portal

References:

Tutorials/practical articles:

Databases

Advantage - MySQL - MSSQL - Postgres - Interbase - Firebird - Oracle - ODBC - Paradox - SQLite - dBASE - MS Access - Zeos

This is a list of Frequently Asked Questions (FAQ) regarding database programming with Lazarus.

Where can I find more information?

Databases:

  • See Databases and the articles about using databases/SQLQuery.

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.

Supported databases

Known issues

Are there other components?

Lazarus and FPC documentation

The Lazarus visual database controls use FPC database code. Please see SQLDB documentation for more information.

Background info on SQLDB: SqlDBHowto

More info on TSQLQuery: Working With TSQLQuery

Lazarus documentation