Properties
CustomSeparator
DataSet
DelimitedFields
ErrorRecords
FieldDelimiter
FieldList
FieldListAction
FieldSeparator
ImportType
InputFile
MaxRecords
ShowProgress
Version


TCSVImport.CustomSeparator Next Top
Specifies what field separator character to expect.

property CustomSeparator: string;

Description

This property enables the component to read ASCII files with non-standard field separators.

This property is ignored when the FieldSeparator property is set to any value other then fspCustom.

When a value is entered for this property, either while designing or at runtime, only the first, non-blank, character is stored.



TCSVImport.DataSet Previous Next Top
The destination data set.

property DataSet: TDataSet;

Description

Set the DataSet property to indicate which data set to add new records to. An exception is raised if no data set is assigned.

The component will automatically attempt to open the data set if it is not already open but will not close the data set after executing.

The CanModify property of the data set will be tested and execution will halt if this is false.



TCSVImport.DelimitedFields Previous Next Top
Specifies where to expect quotation marks around field data.

type TDelimitedFields = (dfAll, dfTextOnly);
property DelimitedFields: TDelimitedFields;

Description

If the FieldDelimiter property is set to fdlSingle or fdlDouble then the component will expect either single or double quotation marks to appear before and after field data.

If DelimitedFields is set to dfALL then the component expects all fields to be surrounded by quotation marks.

Example:

‘1234’,’Address1’,’Address2’,’22/05/1971’
If DelimitedFields is set to dfTextOnly then the component expects only string fields to be surrounded by.

Example:

1234,’Address1’,’Address2’,22/05/1971
This property is ignored if the FieldDelimiter is set to fdlNone.


TCSVImport.ErrorRecords Previous Next Top
After execution has completed ErrorRecords will indicate how many records could not be appended to the data set due to exceptions.

property ErrorRecords: integer;

Description

Records will not be appended when data conversion errors occur, key violations occur and referential integrity rules are broken.



TCSVImport.FieldDelimiter Previous Next Top
Specifies what field delimiter to expect.

type TFieldDelimiter = (fdlNone, fdlSingle, fdlDouble);
property FieldDelimiter: TFieldDelimiter;

Description

If FieldDelimiter is set to fdlSingle then the component expects single quotation marks to appear before and after field data.

Example:

‘1234’,’Address1’,’Address2’,’22/05/1971’
If FieldDelimiter is set to fdlDouble then the component expects double quotation marks to appear before and after field data.

Example:

“1234”,”Address1”,”Address2”,”22/06/1971”
If FieldDelimiter is set to fdlNone then the component will treat quotation marks as part of the data.


TCSVImport.FieldList Previous Next Top
Holds the names of fields to include or exclude.

property FieldList: TStrings;

Description

If the FieldListAction is set to flaInclude or flaExclude then the component will check the FieldList property for each field in the data set.

Field names in the list are not treated as case sensative but each field name must be in a separate strings.



TCSVImport.FieldListAction Previous Next Top
Indicates that certain fields are to be included or excluded from the import.

type TFieldListAction = (flaNone, flaInclude, flaExclude);
property FieldListAction: TFieldListAction;

Description

flaNone

No action is taken to include or exclude fields.
flaInclude
Only those fields entered in the FieldList are included in the import process.

This has the effect of creating a 'virtual' data set.

flaExclude
Those fields entered in the FieldList are excluded from the import process.

This has the effect of creating a 'virtual' data set.



TCSVImport.FieldSeparator Previous Next Top
Specifies what character to expect fields to be separated by.

type TFieldSeparator = (fspPipe, fspTab, fspComma, fspCustom, fspNone);
property FieldSeparator: TFieldSeparator;

Description

fspPipe

The component will expect fields to be separated by the ASCII character 124.
fspTab
The component will expect fields to be separated by the ASCII character 9.
fspComma
The component will expect fields to be separated by the ASCII character 44.
fspCustom
The component will expect fields to be separated by the ASCII character specified by the CustomSeparator property.
If the ImportType property is set to impFixed then this property is ignored.


TCSVImport.ImportType Previous Next Top
Specifies that the ASCII data is in fixed length or delimited format.

type TImportType = (impDelimited, impFixed);
property ImportType: TImportType;

Description

impFixed

The ASCII data is split into fields when the character specified by FieldSeparator, or CustomSeparator if FieldSeparator is set ot fspNone, is found in the data.
impFixed
The ASCII data is split into fields using the Size property if each field.


TCSVImport.InputFile Previous Next Top
The full path and name of the ASCII data file to import.

property InputFile: string;

Description

The InputFile property must be a full path and file name and can be a UNC name.

An exception is raised if the file or path are invalid.



TCSVImport.MaxRecords Previous Next Top
Can be used to limit the number of records imported.

property MaxRecords: integer;

Description

Use MaxRecords to instruct the component to finish importing once a given number of records have been read.

Set MaxRecords to 0 to continue importing until the end of the ASCII data file.



TCSVImport.ShowProgress Previous Next Top
The component will show a progress window while processing.

property ShowProgress: boolean;

Description

Set ShowProgress to True and the component will show the following progress window while processing:

File
The name of the ASCII data file being imported.
Records
The number of records imported so far.
Bytes
The number of bytes read and the average bytes per second.
Time
Estimated time to completely read the data file.
Progress
Percentage of file read based on bytes read and size of the data file.


TCSVImport.Version Previous Top
Release version of the component.

property Version: string;

Description

A read-only string indicating the version number of the component and distribution permission.


11 November 1998 18:43:51
Copyright © 1998 Watt Computers.