home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / database / car / daxsamp / readme.txt < prev    next >
Encoding:
Text File  |  1996-02-22  |  7.9 KB  |  182 lines

  1.  
  2.  **********************************************************************
  3.  * DISCLAIMER OF WARRANTIES:                                          *
  4.  *                                                                    *
  5.  * The following enclosed code is sample code created by IBM          *
  6.  * Corporation.  This sample code is not part of any standard IBM     *
  7.  * product and is provided to you solely for the purpose of assisting *
  8.  * you in the development of your applications.  The code is provided *
  9.  * "AS IS", without warranty of any kind.  IBM shall not be liable    *
  10.  * for any damages arising out of your use of the sample code, even   *
  11.  * if they have been advised of the possibility of such damages       *
  12.  *                                                                    *
  13.  **********************************************************************
  14.  
  15. NAME:  DAXSAMP Database DLL
  16. ---------------------------
  17.  
  18. FEATURES/CONCEPTS :
  19.  
  20.    This sample creates a DLL to access an existing dBase database
  21.    using ODBC.
  22.  
  23.    You may recreate the DLL to access the existing dBase database or
  24.    to other ODBC or DB2 databases. The name of the other datasource must be
  25.    DAXSAMP in order for the samples to build and run correctly.
  26.  
  27. DESCRIPTION
  28.  
  29.    This sample contains a DLL, LIB, .HPP and a .VBE file to support access to
  30.    the supplied dBase DAXSAMP database.
  31.  
  32.    The .HPP, DLL, LIB and .VBE files are used by the CarEdit
  33.    and the CarBrws samples. For a description of how they are used please
  34.    refer to the readmes for CarEdit and CarBrws.
  35.  
  36.    NOTE : If you are running the CarEdit and CarBrws samples from the command
  37.           line, you must first copy Car.DLL to a directory on your path
  38.           or the CarEdit or CarBrws directory.
  39.  
  40.    NOTE:  You need not create a datasource or build the DLL in order to
  41.           proceed to the CarBrws and the CarEdit samples,
  42.           because the DAXSAMP datasource and
  43.           a complete DLL have been provided for that purpose.
  44.  
  45. PROJECT/SOURCE FILE LOCATION
  46.  
  47.    X:\IBMCPPW\SAMPLES\DATABASE\CAR\DAXSAMP
  48.  
  49.    where X: is the drive on which you installed the samples
  50.    component of VisualAge C++.
  51.  
  52.  
  53. NOTE:  By default, the supplied Car.DLL can be used with the CarBrws and CarEdit
  54.        samples. This DLL access the supplied DAXSAMP dBase database using ODBC.
  55.  
  56.        The following description applies on how to rebuild the sample using the
  57.        supplied DBASE database.
  58.  
  59.        You may also use this sample against local or remote database such as DB2
  60.        using embedded SQL, CLI or ODBC or you may also use this sample with
  61.        other ODBC Databases such as SYBASE or ORACLE.
  62.  
  63. HOW TO BUILD THE SAMPLE:
  64.  
  65.   1) Change to the X:\ibmcppw\samples\database\stockcpp directory--where
  66.      'X:' is the drive you installed the samples component of
  67.      VisualAge for C++.
  68.  
  69.      - If you are using Workframe  Invoke the workframe project by typing
  70.  
  71.          iwf daxsamp.iwp.
  72.  
  73.   2) If you wish to regenerate the Data Access Builders code you may do so
  74.      using the supplied .DAX file. If you use the supplied .DAX file then from
  75.      the command line type
  76.  
  77.        IDATA DAXSAMP.DAX
  78.  
  79.      then proceed to step 3.
  80.  
  81.      If you are not using the supplied .DAX file from the command line type
  82.  
  83.        IDATA
  84.  
  85.      If you are using workframe :
  86.  
  87.        If you wish to use the existing .DAX file, click the right mouse button
  88.        and select Database.
  89.  
  90.        If you wish not to use the supplied .DAX file, select the Project menu
  91.        item and select Database.
  92.        You may then proceed to step 3.
  93.  
  94.  
  95.      Create the table mappings by doing the following:
  96.  
  97.        a. Click on Create Classes from the Data Access Builder's startup window
  98.           or select Create Classes from the File menu.
  99.        b. Select ODBC DataSources for the Database Type field.
  100.           - NOTE: if you are retargeting the sample to use CLI or Embedded SQL,
  101.                   choose the DB2 Version.
  102.        b. Select DAXSAMP database and click on Connect.
  103.        c. Click on CAR Table and then Create classes.
  104.        d. From the Generate Options window select C++ Visual Builder Part,
  105.           then select ODBC as the access method and click on OK.
  106.           The table class mappings are now shown.
  107.           - NOTE: if you are retargeting the sample to use CLI or Embedded SQL,
  108.                   choose the appropriate access method with C++ Visual Builder
  109.                   Part.
  110.        e. Double click on the CAR class icon (blue sphere). The class
  111.           notebook is shown.  On the Names page:
  112.             - deselect the Generate Makefile check box then double click on the
  113.               close box.
  114.        f. The mapping is done. You can save this mapping by selecting Save from
  115.           the File menu.
  116.  
  117.   3) Click Mouse Button 2 on each of the class icons (blue spheres) in turn,
  118.      select GENERATE for each from the pop-up menu.  Close the Data Access
  119.      Builder session by selecting Exit from the File menu.
  120.  
  121.   4) To build the executable for ODBC or CLI from the command line type:
  122.  
  123.        nmake
  124.  
  125.      NOTE : If you are rebuilding for Embedded SQL, type
  126.  
  127.        nmake -f esql.mak.
  128.  
  129.      From Workframe :
  130.  
  131.       Select Build Normal from the Project menu item.
  132.  
  133.       NOTE: If you are rebuilding the sample to use Embedded SQL, you must first
  134.             select the build normal option via the option pull-down and you must
  135.             choose the DB2 Precompile option.
  136.  
  137. FILE NAME(S)     DESCRIPTION
  138. ============     ===========
  139.  
  140. RESETTBO.BAT     This file resets the Car table to its intial state.
  141.                  Use this file when using ODBC.
  142. RESETTBC.BAT     This file resets the Car table to its inital state.
  143.                  Use this file when using CLI.
  144. RESETTBE.BAT     This file resets the Car table to its intial state.
  145.                  Use this file when using Embedded SQL.
  146. MAKEFILE         This is the makefile used to build the sample application from
  147.                  the command line.
  148. CRTDB.BAT        This file creates a local DB2 database called DAXSAMP.
  149.                  You must run RESETTBE or RESETTBC after creating the local DB2
  150.                  database to create and populate the database tables.
  151.                  NOTE: If you are accessing a remote DB2 server, the database
  152.                        must be created on the remote server and cataloged on the
  153.                        local client.
  154. ESQL.MAK         Use this Make file is you are recreating the application from
  155.                  the command line and are using Embedded SQL.
  156. README.TXT       This file.
  157. DAXSAMP.DAX      This file is used to regenerate the Data Access Builder files
  158.                  if you want to rebuild the sample.
  159. DAXSAMP.IWO      This file is used to store the options associated with the
  160.                  workframe project.
  161. DAXSAMP.IWP      This file is used to invoke the workframe project associated
  162.                  with this sample.
  163. CAR.DLL          The access DLL for the DAXSAMP database. This DLL is used by
  164.                  the CarEdit and CarBrws samples.
  165. CAR.LIB          Used for linking with CAR.DLL.
  166. CAR.HPP          Used for rebuilding CarEdit and CarBrws.
  167. ESQL.MAK         Use this Make file is you are recreating the application from
  168.                  the command line and are using Embedded SQL.
  169. CAR.VBE          Describes the Car and the CarManager classes to the Visual
  170.                  Builder. This file is used if you want to rebuild the CarEdit
  171.                  or CarBrws samples.
  172.  
  173. The following files are used by dBase:
  174.  
  175.                  CAR.DBF       - Car table
  176.                  INVENTO.DBF   - Invento table
  177.                  RECEIVE.DBF   - Receive table
  178.                  CAR.MDX       - UNIQUE index using the License field
  179.                  INVENTO.MDX   - UNIQUE index using the pNumber field
  180.                  RECEIVE.MDX   - UNIQUE index using the rNumber field
  181.                  QEDBF.INI     - Internal to dBase
  182.