
 **********************************************************************
 * DISCLAIMER OF WARRANTIES:                                          *
 *                                                                    *
 * The following enclosed code is sample code created by IBM          *
 * Corporation.  This sample code is not part of any standard IBM     *
 * product and is provided to you solely for the purpose of assisting *
 * you in the development of your applications.  The code is provided *
 * "AS IS", without warranty of any kind.  IBM shall not be liable    *
 * for any damages arising out of your use of the sample code, even   *
 * if they have been advised of the possibility of such damages       *
 *                                                                    *
 **********************************************************************

NAME:  DAXSAMP Database DLL
---------------------------

FEATURES/CONCEPTS :

   This sample creates a DLL to access an existing dBase database
   using ODBC.

   You may recreate the DLL to access the existing dBase database or
   to other ODBC or DB2 databases. The name of the other datasource must be
   DAXSAMP in order for the samples to build and run correctly.

DESCRIPTION

   This sample contains a DLL, LIB, .HPP and a .VBE file to support access to
   the supplied dBase DAXSAMP database.

   The .HPP, DLL, LIB and .VBE files are used by the CarEdit
   and the CarBrws samples. For a description of how they are used please
   refer to the readmes for CarEdit and CarBrws.

   NOTE : If you are running the CarEdit and CarBrws samples from the command
          line, you must first copy Car.DLL to a directory on your path
          or the CarEdit or CarBrws directory.

   NOTE:  You need not create a datasource or build the DLL in order to
          proceed to the CarBrws and the CarEdit samples,
          because the DAXSAMP datasource and
          a complete DLL have been provided for that purpose.

PROJECT/SOURCE FILE LOCATION

   X:\IBMCPPW\SAMPLES\DATABASE\CAR\DAXSAMP

   where X: is the drive on which you installed the samples
   component of VisualAge C++.


NOTE:  By default, the supplied Car.DLL can be used with the CarBrws and CarEdit
       samples. This DLL access the supplied DAXSAMP dBase database using ODBC.

       The following description applies on how to rebuild the sample using the
       supplied DBASE database.

       You may also use this sample against local or remote database such as DB2
       using embedded SQL, CLI or ODBC or you may also use this sample with
       other ODBC Databases such as SYBASE or ORACLE.

HOW TO BUILD THE SAMPLE:

  1) Change to the X:\ibmcppw\samples\database\stockcpp directory--where
     'X:' is the drive you installed the samples component of
     VisualAge for C++.

     - If you are using Workframe  Invoke the workframe project by typing

         iwf daxsamp.iwp.

  2) If you wish to regenerate the Data Access Builders code you may do so
     using the supplied .DAX file. If you use the supplied .DAX file then from
     the command line type

       IDATA DAXSAMP.DAX

     then proceed to step 3.

     If you are not using the supplied .DAX file from the command line type

       IDATA

     If you are using workframe :

       If you wish to use the existing .DAX file, click the right mouse button
       and select Database.

       If you wish not to use the supplied .DAX file, select the Project menu
       item and select Database.
       You may then proceed to step 3.


     Create the table mappings by doing the following:

       a. Click on Create Classes from the Data Access Builder's startup window
          or select Create Classes from the File menu.
       b. Select ODBC DataSources for the Database Type field.
          - NOTE: if you are retargeting the sample to use CLI or Embedded SQL,
                  choose the DB2 Version.
       b. Select DAXSAMP database and click on Connect.
       c. Click on CAR Table and then Create classes.
       d. From the Generate Options window select C++ Visual Builder Part,
          then select ODBC as the access method and click on OK.
          The table class mappings are now shown.
          - NOTE: if you are retargeting the sample to use CLI or Embedded SQL,
                  choose the appropriate access method with C++ Visual Builder
                  Part.
       e. Double click on the CAR class icon (blue sphere). The class
          notebook is shown.  On the Names page:
            - deselect the Generate Makefile check box then double click on the
              close box.
       f. The mapping is done. You can save this mapping by selecting Save from
          the File menu.

  3) Click Mouse Button 2 on each of the class icons (blue spheres) in turn,
     select GENERATE for each from the pop-up menu.  Close the Data Access
     Builder session by selecting Exit from the File menu.

  4) To build the executable for ODBC or CLI from the command line type:

       nmake

     NOTE : If you are rebuilding for Embedded SQL, type

       nmake -f esql.mak.

     From Workframe :

      Select Build Normal from the Project menu item.

      NOTE: If you are rebuilding the sample to use Embedded SQL, you must first
            select the build normal option via the option pull-down and you must
            choose the DB2 Precompile option.

FILE NAME(S)     DESCRIPTION
============     ===========

RESETTBO.BAT     This file resets the Car table to its intial state.
                 Use this file when using ODBC.
RESETTBC.BAT     This file resets the Car table to its inital state.
                 Use this file when using CLI.
RESETTBE.BAT     This file resets the Car table to its intial state.
                 Use this file when using Embedded SQL.
MAKEFILE         This is the makefile used to build the sample application from
                 the command line.
CRTDB.BAT        This file creates a local DB2 database called DAXSAMP.
                 You must run RESETTBE or RESETTBC after creating the local DB2
                 database to create and populate the database tables.
                 NOTE: If you are accessing a remote DB2 server, the database
                       must be created on the remote server and cataloged on the
                       local client.
ESQL.MAK         Use this Make file is you are recreating the application from
                 the command line and are using Embedded SQL.
README.TXT       This file.
DAXSAMP.DAX      This file is used to regenerate the Data Access Builder files
                 if you want to rebuild the sample.
DAXSAMP.IWO      This file is used to store the options associated with the
                 workframe project.
DAXSAMP.IWP      This file is used to invoke the workframe project associated
                 with this sample.
CAR.DLL          The access DLL for the DAXSAMP database. This DLL is used by
                 the CarEdit and CarBrws samples.
CAR.LIB          Used for linking with CAR.DLL.
CAR.HPP          Used for rebuilding CarEdit and CarBrws.
ESQL.MAK         Use this Make file is you are recreating the application from
                 the command line and are using Embedded SQL.
CAR.VBE          Describes the Car and the CarManager classes to the Visual
                 Builder. This file is used if you want to rebuild the CarEdit
                 or CarBrws samples.

The following files are used by dBase:

                 CAR.DBF       - Car table
                 INVENTO.DBF   - Invento table
                 RECEIVE.DBF   - Receive table
                 CAR.MDX       - UNIQUE index using the License field
                 INVENTO.MDX   - UNIQUE index using the pNumber field
                 RECEIVE.MDX   - UNIQUE index using the rNumber field
                 QEDBF.INI     - Internal to dBase
