Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
1732 00 JVCL Components minor always 2004-05-06 14:18 2005-08-10 02:45
anonymous  
obones  
normal  
resolved  
fixed  
none    
none 3.10  
0001732: TJvCsvDataSet parse error leaves data loaded
A poorly formatted CSV file was loaded into a TJvCsvDataSet.
The dataset was opened, and as expected, an exception was raised indicating a parsing error. However, when the file was fixed, and reopened during the same run of the program, the component still reported a parsing error.

A glance at the code seems to show that the internal TStrings is not emptied and freed if a parsing error occurs, as it would during a normal open operation. The fact that the internal TStrings exists is used to determine whether the data should be loaded again. As the object still exists, the component believes it is not supposed to load the object again, and therefore the erroneous data remains in memory instead of being replaced by a new version of the file.

Properties for the component in a form where this error occurred are listed in Additional Information. A sample file that caused the problem is attached. Basically, the CSV file had a series of commas on the first line instead of the field names.
Properties:
  object csvInput: TJvCsvDataSet
    ReadOnly = True
    Changed = False
    CsvUniqueKeys = False
    ExtendedHeaderInfo = False
    CaseInsensitive = False
    SavesChanges = False
    AutoBackupCount = 0
    Left = 32
    Top = 24
  end

File:
,,
"LastName","FirstName","Title"
"Schmoe","Joe","CFO"
"Smith","Jane","CEO"
"Jones","Sam","Manager"
csv file icon test.csv [^] (103 bytes) 2004-05-06 14:18
Issue History
2004-05-06 14:18 anonymous New Issue
2004-05-06 14:18 anonymous File Added: test.csv
2004-05-11 14:22 anonymous Note Added: 0004214
2005-08-10 02:15 obones Note Added: 0007758
2005-08-10 02:15 obones Status new => confirmed
2005-08-10 02:45 obones Status confirmed => resolved
2005-08-10 02:45 obones Resolution open => fixed
2005-08-10 02:45 obones Assigned To => obones
2005-08-10 02:45 obones Note Added: 0007759

Notes
(0004214)
anonymous   
2004-05-11 14:22   
In addition, changing the source file, even while the table is inactive, has other odd effects. For example, some of the CVSHeader properties are not cleared completely.
(0007758)
obones   
2005-08-10 02:15   
Confirmed with the latest CVS code base. Bug fix is in progress.
(0007759)
obones   
2005-08-10 02:45   
This is now fixed in CVS.