Data Access Builder Workflow

ngos2.gif (402 bytes)ngwin.gif (1069 bytes)Windows and OS/2 Workflow

  1. Creating a New Data Access Part
    Data Access applications use C++ code to access a database. To create a Data Access application, first create a Data Access target in the Integrated Development Environment (IDE) (see Create a Project and Add or Change a Target).

    Then create a new Data Access part in that target. This launches the Data Access Builder SmartGuide, where Data Access Builder creates a mapping from a database schema (a database table, view, or an SQL query). The mapping contains sufficient information for Data Access Builder to generate C++ classes. For example, it has definitions for all attributes matching all the columns in the database table, view, or SQL query.

    When you finish creating the mapping, the new Data Access part is added to the Data Access Launch view in the IDE. The part consists of the following files:

    Note: Only one Data Access part can be created for a target. This means that only one Data Access session (a .dax file) can be associated with a target. However, you may include in that session several schemas and mappings.

  2. Editing a Data Access Part
    Once the part is created, customize the mapping to suit your application's needs. For example, you can change attribute names or add your own methods. To edit the new part, select it and click the Edit Part button. This will launch the Data Access Builder main window. See Customize the Mapping for information on the many ways a mapping can be customized.

    You can also add schemas and mappings to the session. To add a schema, select Map Schema from the File menu. To add a mapping, select a schema and then select Create Mapping from the schema's popup menu.

    Save the session information to the IDE. Corresponding .vbe and .vbf files will be added to the Data Access part in the IDE.

    Then generate the code for the mapping (see Generate Source Code). If you chose the ESQL access method, an .sqx file will be generated. Otherwise, if you chose CLI or ODBC, a .cpp file and a .hpp file will be generated.

    When you have finished customizing the mapping, close Data Access Builder and return to the IDE.

  3. Create the Application that Uses the Generated Classes
    Create other visual or nonvisual parts by using the IDE and Visual Builder to create a program that uses the generated data access classes to access and manipulate database tables.  See the Data Access Builder Samples or the Data Access/Visual Builder Tutorial for examples that show how to do this.
  4. Building the Part into the Target
    Now you can Build the project (see Build). This will generate source code, if needed, translate .sqx files into .cxx files, and compile and link all code in the part. The build process uses the default build options for the target type. You can customize these options if you want (see Set Build Options).

ngaix.gif (1051 bytes)AIX Workflow

  1. Launching Data Access Builder and Creating the Mapping
    Start Data Access Builder by running cppdata from the working directory command line.   In the startup window, select Create New Mapping or Work with Existing Mapping.  Create and customize the mapping as needed.
  2. Generating Source Code
    The generated files will be stored in the working directory.
  3. Create the Application that Uses the Generated Classes
    Create other visual or nonvisual parts by using the IDE and Visual Builder to create a program that uses the generated data access classes to access and manipulate database tables.  See the Data Access Builder Samples or the Data Access/Visual Builder Tutorial for examples that show how to do this.
  4. Importing Classes Into the IDE and Building the Project
    In the IDE, create a project and target for your application.  Edit the project's configuration file to list all the .cpp source files for the data access classes, the visual parts, and the non visual parts that make up the program (see Add Part Source to the Configuration File).   Then build the project (see Build)

Data Access/Visual Builder Tutorial
Creating a Visual Data Access Application - Follow the instructions in this tutorial to create a basic data access application visually.



Data Access Builder


IDE: Create a Project
IDE: Add or Change a Target
IDE: Build
IDE: Set Build Options
IDE: Add Source Files to a Project
IDE: Add Part Source to the Configuration File
Create More than One Mapping for a Schema
Map a Schema
Customize the Mapping
Generate Source Code
Import a Data Access Builder Session
Migrate Existing Code
Write Data Access Applications with the Visual Builder


Data Access Class Library and Generated Class Reference
Files in Data Access Parts
Data Access Builder Samples