Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004901 [JEDI VCL] 00 JVCL Components major always 2009-08-22 15:26 2009-10-03 14:25
Reporter dcabale View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0004901: [TJvCsvDataSet] loading successively different csv files in a same TJvCsvDataSet fires un unexpected exception
Description Hi,

all is told in the title, but you can make the following test:

1. create 2 .csv files:

//////////// test1.csv ////////////
name,address1,address2
didier,"37, Av.",condom
//////////// end of file //////////

//////////// test2.csv ////////////
name,address3,address4
didier,"37, Av.",condom
//////////// end of file //////////

Note that these files have not the same field names

2. On a Button click, code what follows:
//////////// code /////////////////
JvCsvDataSet1.LoadFromFile('test1.csv');
JvCsvDataSet1.LoadFromFile('test2.csv');
//////////// end of code //////////

Execute this code.
Then an unexpected exception telling that "Field address1 in file, but not in field definitions" is fired.
This exception is unexpected, because procedure LoadFromFile first 'Closes' the dataset, and should forget all of what has been previously loaded.
Additional Information as a fix, modify procedure TJvCustomCsvDataSet.InternalInitFieldDefs as follows:
...
    // existing code
    FieldDefs.Clear; // Clear VCL Database field definitions
    FCsvColumns.Clear; // Clear our own CSV related field Data
//////////////////////////////////////////
/// added by DCA on 22/08/2009
  FHeaderRow := '';
/// end of adding
    // existing code
    aCsvFieldDef := CsvFieldDef;
...
Tags JvCSVDataset, LoadFromFile
Attached Files zip file icon LoadSuccessiveToJvCsvDataset.zip [^] (1,472 bytes) 2009-09-11 16:04

- Relationships
related to 0004935resolvedAHUser CSVDataset error (actually v 3.38) 

-  Notes
(0016065)
obones (administrator)
2009-09-09 19:34

Hello,

We would really like to have the zipped sources of a sample application showing this, along with the csv files.
(0016089)
dcabale (reporter)
2009-09-11 16:06

Please find it above.
Best regards
(0016098)
JeremyKnowles (reporter)
2009-09-14 12:24

See also 0004935
(0016219)
AHUser (developer)
2009-10-02 10:59

This is now fixed in SVN.
(0016225)
obones (administrator)
2009-10-03 13:13

Didier tells me that this is not solved. He will add a not here detailing this.
(0016226)
dcabale (reporter)
2009-10-03 13:21

JvCsvData.pas 12499 2009-09-14 18:48:01Z out of JVCL3-Source-2009-10-02.zip does not fix the bug. To show this, please run the project in the attached file.
(0016228)
AHUser (developer)
2009-10-03 14:25

Looks like you must wait for the 2009-10-03 daily build. I changed the file yesterday and 2009-09-14 isn't yesterday ;-)

- Issue History
Date Modified Username Field Change
2009-08-22 15:26 dcabale New Issue
2009-09-09 19:34 obones Note Added: 0016065
2009-09-09 19:34 obones Status new => feedback
2009-09-11 16:03 dcabale Tag Attached: JvCSVDataset
2009-09-11 16:03 dcabale Tag Attached: LoadFromFile
2009-09-11 16:04 dcabale File Added: LoadSuccessiveToJvCsvDataset.zip
2009-09-11 16:06 dcabale Note Added: 0016089
2009-09-14 12:24 JeremyKnowles Note Added: 0016098
2009-09-14 14:01 obones Relationship added related to 0004935
2009-10-02 10:59 AHUser Note Added: 0016219
2009-10-02 10:59 AHUser Status feedback => resolved
2009-10-02 10:59 AHUser Fixed in Version => Daily / SVN
2009-10-02 10:59 AHUser Resolution open => fixed
2009-10-02 10:59 AHUser Assigned To => AHUser
2009-10-03 13:06 dcabale Issue Monitored: dcabale
2009-10-03 13:06 dcabale Issue End Monitor: dcabale
2009-10-03 13:06 dcabale Issue Monitored: dcabale
2009-10-03 13:06 dcabale Issue End Monitor: dcabale
2009-10-03 13:13 obones Note Added: 0016225
2009-10-03 13:13 obones Status resolved => feedback
2009-10-03 13:13 obones Resolution fixed => reopened
2009-10-03 13:21 dcabale Note Added: 0016226
2009-10-03 14:25 AHUser Note Added: 0016228
2009-10-03 14:25 AHUser Status feedback => resolved
2009-10-03 14:25 AHUser Resolution reopened => fixed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker