Unit TxtToTbl |
------------------------------------------------------------------------------- Delphi (1.0 and 2.0) Component TTextToTable Version 1.0 Copyright 1996 South Carolina Department of Health and Environmental Control This material was written utilizing resources of the state government of South Carolina, hence it is released to public domain. Author: Ryan P. Cote coterp@columb64.dhec.state.sc.us South Carolina Department of Health and Environmental Control Columbia, South Carolina Purpose: Imports data from a non-delimited text file into a Delphi table component. It reads format from table component and grabs data from the text file based on the field widths in the table. The component does not do any translation on the data in the text file based on the data type of the fields in the table. Usage: The component is very simple to use. It may be installed on your component palette, or you may manually instantiate it in code. To use the component, set the Table and InputFile properties. The Table property points to the TTable component you wish to import data into. The TTable component must exist (be instantiated) and it must have its TableName and TableType properties set (TableType may be ttDefault). The InputFile must be a valid text file. Once these two properties have been set, you may call either the Append or Replace method. The Append method appends the data in the text file to the data already in the table (if any). The Replace method first deletes all data from the table and then appends the data from the text file. Be cautious with Replace, no warnings will appear before the data in the table is gone forever! The is one small quirk that arrises when the table you are working with is open in the development environment. In this case there will be two open instances of the table (one in the development evironment, and one in your running application). This component tries to gain exclusive control of the table. This cannot happen if the table is open in the development environment. You will get an EDBEngineError exception with a 'Database is busy' message. You must set the Active property on the TTable component in the development environment to false before you run the application. You may set the table back to active in code. Revision History: September 30, 1996 - Version 1.0 -------------------------------------------------------------------------------
Classes |
Functions |
Register -
Types |
Constants |
Variables |
Functions |
Types |
Constants |
Variables |