Sign in Join
Wiki copytemporary

lazdbexport: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: lazdbexport

OldNewLine
1+**lazdbexport** is a package that supplies components to facilitate database export. It is delivered with lazarus and may be installed by using \[Package\|Install/Uninstall packages\]. After install the components are accessible via the Data Export tab. It provides a template class for descendants that can provide export of datasets. Also included are various ready-made descendants for:
2+
3+| icon | Component | Description |
4+|----|----|----|
5+| ![](/wiki-images/0/0a/Tcsvexporter.png) | [[TCSVExporter]] | CSV |
6+| ![](/wiki-images/c/c4/Tfixedlengthexporter.png) | [[TFixedlengthExporter]] | Fixed length |
7+| ![](/wiki-images/5/56/Tsqlexporter.png) | [[TSQLExporter]] | SQL |
8+| ![](/wiki-images/f/ff/Txmlxsdexporter.png) | [[fpXMLXSDExport|TXMLXSDExporter]] | XML/XSD |
9+| ![](/wiki-images/1/13/Tsimplexmlexporter.png) | [[TSimpleXMLExporter]] | XML |
10+| ![](/wiki-images/d/d2/Tsimplejsonexporter.png) | [[TSimpleJSONExporter]] | json |
11+| ![](/wiki-images/c/c0/Tfpdbfexport.png) | [[fpdbfexport|TFPDbfExport]] | dbf |
12+| ![](/wiki-images/a/aa/Ttexexporter.png) | [[TTeXExporter]] | TeX |
13+| ![](/wiki-images/9/9c/Trtfexporter.png) | [[TRTFExporter]] | RTF |
14+| ![](/wiki-images/c/cc/Tstandardexportformats.png) | [[TStandardExportFormats]] | |
15+| ![](/wiki-images/3/37/Tfpdataexporter.png) | [[TFPDataExporter]] | |
16+
17+As indicated, developers can write their own export classes using the export framework. An example of this is the Excel/spreadsheet format exporter in [[FPSpreadsheet]]
18+
19+## Import
20+
21+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).
22+
23+DbImport is used in the [LazSQLX](http://lazsqlx.wordpress.com/) and [TurboBird](http://code.sd/products/turbobird/) database management tools for importing CSV (like) data into datasets.
24+
25+Another form of import is the use of [[TSQLScript]]; an exported database with [[TSQLExporter]] can be imported with the use of [[TSQLScript]].
26+
27+## Example
28+
29+See the examples in your FPC source directory \$(fpcdir)\source\packages\fcl-db\tests (see [[Databases|Running FPC database tests]]), specifically testdbexport.pas.
30+
31+Following is a simplest form of using TCSVExporter. **fpcsvexport** must be included in uses clause.
32+
33+` if SaveDialog1.Execute then `\
34+`    with TCSVExporter.Create(nil) do begin`\
35+`       Dataset:= BufDataSet1;`\
36+`       FileName:= SaveDialog1.FileName;`\
37+`       Execute;`\
38+`       Free;`\
39+`    end;`
40+
41+---
42+*From the Free Pascal wiki, page "lazdbexport", as it stood on 2021-08-16 after a change by Egsuh, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history