tags:

views:

266

answers:

1

I apologise in advance if this question isn't very specific.

Would it be possible to do the following.

when the application loads

read the contents of a CSV file into a dataset.

while the application is running

operate on that dataset exactly as if it were a mysql or mssql or bde database (run queries. insert records. delete records. alter records.)

when the application closes - write the dataset back to the csv file.

+2  A: 

You could load the file into a TClientDataset, operate on the dataset and apply the changes back to a file.

Lieven
OK I've done that. I have the following code in a tbutton...ClientDataSet1->FileName = "c:\\testdata.csv";ClientDataSet1->Open(); AddFiles(Edit1->Text); ClientDataSet1->SaveToFile("c:\\testdata.csv");I get an error saying "missing data provider or data packet" I was hoping that...
MrVimes
... dealing directly with a file wouldn't require a data providor.
MrVimes
It doesn't. Have a look at http://www.youcantwin.com/dasblogce/2007/11/11/TClientDatasetSaveToCsv.aspx for some example code
Lieven