From Lazarus wiki
Revision as of 09:56, 14 November 2014 by BigChimp (talk | contribs) (Created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)



fpdbexport is part of the FreePascal FCL database modules.

It provides a template class for descendants that can provide export of datasets. Also included are various ready-made descendants for:

  • CSV format
  • DBF format; see fpdbfexport
  • Fixed with text files
  • RTF/rich text format
  • Simple JSON
  • Simple XML format
  • SQL insert statements
  • TeX format
  • Various XML formats; see fpxmlxsdexport


As indicated, developers can write their own export classes using the fpdbexport framework. An example of this is the Excel/spreadsheet format exporter in FPSpreadsheet


There is no corresponding import to dataset code in FPC/Lazarus, but there is third party code like dbimport (https://bitbucket.org/reiniero/smalltools/src, directory dbimport). DbImport is used in the LazSQLX and TurboBird database management tools for importing CSV (like) data into datasets.


In Lazarus, the export components are not installed by default. Installation gives a Data Export tab.



See the examples in your FPC source directory $(fpcdir)\source\packages\fcl-db\tests (see Databases#Running_FPC_database_tests), specifically testdbexport.pas.

See also