Logged out, click to login

JEDI Online help - Details

Back to unit JvCsvData.pas Back Edit Search Administration


Returns number of fields that were automatically appended to the file-in-memory when the file was loaded from the disk.

This CSV data component solves a common problem of flat file data users, which is what to do when new fields need to be added to an existing program that uses CSV file data. The solution this component implements is to allow backwards compatibility with all CSV files that contain a subset of the fields defined by your CsvFieldDef.<br> <br> For example, suppose you have a file called Users.csv, and it has two columns (NAME,ADDRESS), and you want to add PHONE_NUMBER. The TJvC vDataSet is smart enough to open the old file with only<br> NAME,ADDRESS, and to fix up the CSV file in-memory, so that it now contains the PHONE_NUMBER field.<br> In this case, you can check if this happened to you by getting AppendedFieldCount.<br> <br> If you call Flush and save the new CSV file, the new field name will be appended to the CSV header (first line of the file), and the file may now be incompatible with other programs if they expect and can only accept the original file fields. Because this automatic upgrading may be a problem, your program may want to warn users before they overwrite a file with a new CSV file that now has more columns than it formerly had.<br> <br> In practice, this makes database upgrades seamless, in most cases, it requires no special handling from the user.<br>

Last changed by obones on 2009-01-05 18:01:39 CET

Copyright (c) 2004 by the JVCL Team; all rights reserved
Uses PclZip by phpconcept and parts of the PEAR library