**********************************************************************
Author: Bruno Fierens
        TMS Software
        J. Jordaens str. 11
        B8510 Marke
        Belgium
        Fax : +32 56 359696
        E-mail: bruno.fierens@skynet.be
        http://users.skynet.be/delphi  : All components page
**********************************************************************

Delphi 3.0/4.0 ODBC based component to open tables in a grid control:

Files :
-----
  olnkd3.zip : component files for Delphi 3.0
  olnkd4.zip : component files for Delphi 4.0
  olnkc3.zip : component files for C++Builder 3.0
  demo.zip   : demo with source code for Delphi 4
               can be used in Delphi 3 after ignoring errors while loading

Release 0.2 beta :
------------------

 Allows to open tables and create new tables from data in grid or a
 listview control using ODBC instead of BDE. 

Feature Revision history :
------------------------

 0.0 : first revision
       Allows to open tables and create new tables from data in grid
 0.1 : C++Builder 3 support added
 0.2 : added support to Insert, Delete & Update rows
       added Listview support
       added support to select fields to load into grid or listview control
       improved datasource handling
       improved ODBC handling
       tested with Microsoft Desktop ODBC drivers for Excel,Access,Text Files,dBase,Foxpro
       added OnError event handler
       improved demo app.


Installation :
--------------

 In Delphi 3,4 or C++Builder 3

 Unzip files olnkd3, olnkd4 or olnkc3 into a component directory

 - Install components,

 - Install into new package (or existing package)

 - Browse for (new) package file

 - Add olnkreg.pas



Usage :
-------

 - To open tables in design mode:

  1) Put the ODBCLINK component on the form
  2) Select the tstringgrid component (or inherited from TStringGrid) to which to link  
  3) Select the driver (depends on installed ODBC drivers on system)
  4) Set the databasefile either to a directory or database file
     (to a directory for dBase type databases and to a file for Access type databases)
  5) Select the table 
  6) Set Active to true

 - To open tables at runtime :
 
  1) To use OpenDatabase, first set properties Driver, Table
  2) Use BrowseDatabase to prompt for driver/database/table
     (set doOpen to false to allow setting SQL command after browsing for table,
      otherwise the SQL is the default : SELECT * from TABLE statement)

 - To save tables at runtime :

  1) Set the field names, field types and field sizes for all columns
  2) Set the driver property
  3) Set the table property
  4) Call the SaveDatabase property
 

Component interface :


 TODBCLink = class(TComponent)
             public
              constructor Create(aOwner:tComponent); override;
              destructor Destroy; override;
              procedure OpenDatabase;
              procedure SaveDatabase;
              function BrowseDatabase(doOpen:boolean):boolean;
              function DataSources:tstrings;
              function Drivers:tstrings;
              function HasDataType(sqltype:integer):boolean;
              function CreateDataSource(szDriver,szAttr:string):boolean;
              function InsertRows(RowIndex,RowCount:integer):boolean;
              function UpdateRows(RowIndex,RowCount:integer):boolean;
              function DeleteRows(RowIndex,RowCount:integer):boolean;
              property Status:tODBCStatus read fODBCStatus;
              property KeyType:tODBCKeyType read fKeyType write fKeyType;
             published
              property Active:boolean read fActive write SetActive;
              property SQL:tstringlist read fSQL write SetSQL;
              property DataSource:string read fDataSource write SetDataSource;
              property Driver:string read fDriver write SetDriver;
              property Table:string read fTable write SetTable;
              property Databasefile:string read fDBFile write fDBFile;
              property Grid:tStringGrid read fGrid write fGrid;
              property ListView:tListView read fListView write fListview;
              property Fields:TODBCFieldCollection read fFields write SetFieldCollection;
              property ShowFields:boolean read fShowFields write fShowFields;
              property ShowErrors:boolean read fShowErrors write fShowErrors;
              property UserID:string read fUserID write fUserID;
              property Authentication:string read fAuthentication write fAuthentication;
              property OnODBCError:TODBCErrorEvent read fOnODBCError write fOnODBCError;
             end;




Help, hints, tips, bug reports :
------------------------------
Send any remarks to : bruno.fierens@skynet.be
Please clearly state which Delphi or C++Builder version you are using
and which version of the component you are using. In case of doubt,
download the latest version first at http://users.skynet.be/delphi
