Unit DBcvt

Classes

TAscii2DB -
TDB2Ascii - ****************************************************************************}
TFieldStream - A memory stream to contain the field in any length

Functions

GetDatabasePath - of aborttranfer} {******************************************************************************} {Global functions} {******************************************************************************} {Get alias of a table or query.
GetErrorString - global calls

****************************************************************************}
Register - ****************************************************************************}

Types

TDBcvtDateFormat
TDBcvtError
TDBcvtEscape
TDBcvtEscapes
TDBcvtMode
TParseEvent
TPrePostEvent

Constants

DBcvtVersion

Variables


Functions


function GetDatabasePath(aDataSet: TDBDataSet): string;

of aborttranfer} {******************************************************************************} {Global functions} {******************************************************************************} {Get alias of a table or query. Returns empty if not found

function GetErrorString(Ecode: TDBcvtError): string;

global calls

****************************************************************************}


procedure Register;

****************************************************************************}

Types


TDBcvtDateFormat = (dfWindows, dfMDY, dfDMY, dfYMD, dfBCD);

TDBcvtError = (eOK,
		eNoExclusiveAccess,
		eAsciiFileNotFound,
		eNoFieldsInList,
		eDataTypeMismatch,
		eFieldNotInTable,
		eFieldTooLong,
		eNoAsciiFileAccess,
		eTooManyFieldsInList,
		eNoIndexFieldFound,
		eIndexFieldNotInList,
		eMissingFieldWidth,
		eAppendOrEditError,
		ePostError,
		eUserAborted,
		eTableMissing,
		eBadDatabaseName,
		eAsciiNameMissing,
		eCantOpenErrorFile,
		eErrorFileWriteError,
		eNoRecordsFound,
		eFieldCount,
		eConversion,
		eKeyViolation,
		eMemoTooLong,
		eMultiError,
    eOtherDatabaseError,
		eCannotOpenTable,
    eExportFileWriteError
		);

TDBcvtEscape =  (esNL, esCR, esHT, esBslash, esSquote, esDquote, esQues, esNull);
escape enumberations
TDBcvtEscapes = set of TDBcvtEscape

TDBcvtMode = (mCopy, mAppend, mUpdate, mAppendUpdate);

TParseEvent = procedure(Sender: TObject; var ParsedList: TList;
								aRecord: string; var NumberOfFields: LongInt) of object
my parse event
TPrePostEvent = procedure(Sender: TObject; var ATable: TTable; var OkToPost: boolean) of object

Constants

DBcvtVersion = '2.0b'

Unit to import an ascii delmited file in to a (paradox) table On a 486/33 this parses about 150 lines per second (with 10 fields per line.) Its not fast but it works real good. Author: William R. Florac Company: FITCO, Verona, WI (wee little company from my house) Copyright 1996, FITCO. All rights reserved. 1) Users of DBCVT (and its components) must accept this disclaimer of warranty: "DBCVT is supplied as is. The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages, direct or conse- quential, which may result from the use of DBCVT." 2) This Software is donated to the public as public domain except as noted below. 3) If you distribute this software, you must include all parts and pages without modification. 4) Software may be used, modified and distributed freely if compiled in with commercial or private applications (not another VCL). 5) Fitco retains the copyright to this Software. You may not distribute the source code (PAS) or its compiled unit (DCU) for profit. 6) If you do find this component handy and you feel guilty for using such a great product without paying someone, please feel free to send a few bucks ($25) to support further development. . I have spent a lot of time making this VCL the best it can be and have included a help file to make it complete. 7) This file was formatted with tabs set to 2. 8) Thanks to all those who suggested (and got) improvements. 9) Latest version can always be found at http://sumac.etcconnect.com/~fitco/ Please forward any comments or suggestions to Bill Florac at: email: flash@etcconnect.com mail: FITCO 209 Jenna Dr Verona, WI 53593 Suppored: paradox Tfield example notes ---------- ----------- ------------ ------------ Alpha ftString "" 255 char max Number ftFloat "100.00" () and , allowed Money ftCurrency "12.75" (), $ and , are allowed Short ftSmallInt "100" -32,768 to 32,767, LongInt ftInteger "100000: -2,147,483,648 to 2,147,483,647 BCD ftBCD "100.00" 18 digits Data ftDate "11/15/95" Time ftTime "2:30pm" or "14:00" TimeStamp ftDateTime "1/1/96 6:00am" Memo ftMemo "" Formated Memo ftBlob No support Graphic ftGraphic No support OLE ftBlob No support Logical ftBoolean "F" or "False" AutoIncrement ftInteger No support Binary ftBlob No support Bytes ftBytes No support For all above decimals can be represented as 10E10 and -10E-10 Integers can be represented in hex $XXXX. Note: Delphi 2 does NOT support negive hex numbers (-$XXXX) as 1.0 did

Variables