Sign in Join
Wiki copytemporary

lazdbexport: what changed

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

OldNewLine
11**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:
22
33| icon | Component | Description |
44|----|----|----|
55| ![](/wiki-images/0/0a/Tcsvexporter.png) | [[TCSVExporter]] | CSV |
66| ![](/wiki-images/c/c4/Tfixedlengthexporter.png) | [[TFixedlengthExporter]] | Fixed length |
77| ![](/wiki-images/5/56/Tsqlexporter.png) | [[TSQLExporter]] | SQL |
88| ![](/wiki-images/f/ff/Txmlxsdexporter.png) | [[fpXMLXSDExport|TXMLXSDExporter]] | XML/XSD |
99| ![](/wiki-images/1/13/Tsimplexmlexporter.png) | [[TSimpleXMLExporter]] | XML |
1010| ![](/wiki-images/d/d2/Tsimplejsonexporter.png) | [[TSimpleJSONExporter]] | json |
1111| ![](/wiki-images/c/c0/Tfpdbfexport.png) | [[fpdbfexport|TFPDbfExport]] | dbf |
1212| ![](/wiki-images/a/aa/Ttexexporter.png) | [[TTeXExporter]] | TeX |
1313| ![](/wiki-images/9/9c/Trtfexporter.png) | [[TRTFExporter]] | RTF |
1414| ![](/wiki-images/c/cc/Tstandardexportformats.png) | [[TStandardExportFormats]] | |
1515| ![](/wiki-images/3/37/Tfpdataexporter.png) | [[TFPDataExporter]] | |
1616
1717As indicated, developers can write their own export classes using the export framework. An example of this is the Excel/spreadsheet format exporter in [[FPSpreadsheet]]
1818
1919## Import
2020
2121There 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).
2222
2323DbImport 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.
2424
2525Another form of import is the use of [[TSQLScript]]; an exported database with [[TSQLExporter]] can be imported with the use of [[TSQLScript]].
2626
2727## Example
2828
2929See the examples in your FPC source directory \$(fpcdir)\source\packages\fcl-db\tests (see [[Databases|Running FPC database tests]]), specifically testdbexport.pas.
3030
3131Following is a simplest form of using TCSVExporter. **fpcsvexport** must be included in uses clause.
3232
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;`
33+``` pascal
34+ if SaveDialog1.Execute then
35+ with TCSVExporter.Create(nil) do begin
36+ Dataset:= BufDataSet1;
37+ FileName:= SaveDialog1.FileName;
38+ Execute;
39+ Free;
40+ end;
41+```
4042
4143---
4244*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