View Issue Details

IDProjectCategoryView StatusLast Update
0004901JEDI VCL00 JVCL Componentspublic2009-10-03 14:25
ReporterdcabaleAssigned ToAHUser 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.39 
Summary0004901: [TJvCsvDataSet] loading successively different csv files in a same TJvCsvDataSet fires un unexpected exception
DescriptionHi,

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 Informationas 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;
...
TagsJvCSVDataset, LoadFromFile

Relationships

related to 0004935 resolvedAHUser CSVDataset error (actually v 3.38) 

Activities

obones

2009-09-09 19:34

administrator   ~0016065

Hello,

We would really like to have the zipped sources of a sample application showing this, along with the csv files.

2009-09-11 16:04

 

LoadSuccessiveToJvCsvDataset.zip (1,472 bytes)

dcabale

2009-09-11 16:06

reporter   ~0016089

Please find it above.
Best regards

JeremyKnowles

2009-09-14 12:24

reporter   ~0016098

See also 0004935

AHUser

2009-10-02 10:59

developer   ~0016219

This is now fixed in SVN.

obones

2009-10-03 13:13

administrator   ~0016225

Didier tells me that this is not solved. He will add a not here detailing this.

dcabale

2009-10-03 13:21

reporter   ~0016226

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.

AHUser

2009-10-03 14:25

developer   ~0016228

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: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