Recent

Author Topic: Dataset's saving to CSV format  (Read 3373 times)

egsuh

  • Hero Member
  • *****
  • Posts: 1273
Dataset's saving to CSV format
« on: August 16, 2021, 01:40:11 am »
I feel like it is good to have a function like SaveToCSVFile, etc. for DataSets.  Currently I can use TCSVDataSet.CopyFromDataSet, and then TCSVDataSet.SaveToCSV to export to CSV file.

This is done correctly, but as noted already, this causes some problem.

https://forum.lazarus.freepascal.org/index.php?topic=49096.0

I have read that there is a package named dBExport, which I haven't tried yet.

I think saving datasets directly to CSV would be very good, via another method of TDataSet.SaveToCSV, or adding CSV format to TDataPacketFormat. 

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Dataset's saving to CSV format
« Reply #1 on: August 16, 2021, 10:51:31 am »
Not a good idea. Where does it stop? The next user needs export to DBF which would pull all DBF code into the standard TDataset codebase, or another user needs export to SQLite3 which would make TDataset dependent on sqlite3 etc. Just to save you from typing some code?

Yes, you should have a look at the dbExport package. This is the way to go. And you don't even have to type any code (if you're lucky).

 

TinyPortal © 2005-2018