----------------------------------------------------
TECH TIP: 1. Using the Query Wizard without the BDE
          2. Using the Query Wizard with ODBC98
----------------------------------------------------

The following information applies to ReportBuilder Pro version 4.



OverView
-----------

The Data Access Development Environment (DADE) in ReportBuilder Pro is built upon the concept of DataView classes. A DataView class is responsible for creating the data access objects required to connect a report to data. At a minimum a DataView will contain at least one DataPipeline. A typical DataView will contain one or more DataPipelines, DataSources, and DataSets.

In addition to creating the data access objects required to connect a report to data, a DataView can also provide functionality to enable the end-user to "design" the data view. One method of delivering this functionality is a data wizard. 

TdaQueryDataView is an abstract ancestor for query based DataViews that use the ReportBuilder Query Wizard. An example of a descendant is TdaBDEQueryDataView which contains a BDE based TQuery component. The job of the Query Wizard is to interact with the end-user and build an SQL statement. The DataView communicates with the Query Wizard to provide information such as lists of available table names, field names, etc. Thus the Query Wizard never references any database objects, but instead relies on functionality provided by the query data view.


End-User <--> Query Wizard <--> Query DataView


This architecture enables the Query Wizard to be used without the BDE. As an example we have created a Query DataView descendant that can be used with ODBC98. 


ODBC98 
-------

ODBC98 is set of native Delphi data access components that provid direct access to ODBC databases without the BDE. The components for the most part mimic the BDE based components found in Delphi - Session, Database, Table, Query, StoredProc, etc.

ReportBuilder is designed to access TDataSet descendants via the DBPipeline component and thus can work with ODBC98 seamlessly right out the box.

However, to use the Query Builder requires that we create a Query DataView descendant. 


ODBC98 DataView Classes
------------------------

Implementing the Query DataView actually requires that we define a set of classes: 

  1.  ODBC98 TDataSet descendants
        - TDataSets that can be children of a DataView.
        - Override the HasParent method of TComponent to return True
        - Must be registerd with the Delphi IDE via RegisterNoIcon           

      a. TdaChildODBC98Query - TODBCQuery descendant 
      b. TdaChildODBC98Table - TODBCTable descendant DataView
      c. TdaChildODBC98StoredProc - TODBCStoredProc descendant 

  2.  TdaODBC98Session
      - descendant of TppSession
      - implements GetDatabaseNames, GetTableNames, etc.

  3.  TdaODBC98DataSet
      - descendant of TppDataSet
      - implements GetFieldNames for SQL

  4.  TdaODBC98QueryDataView
        - descendant of TppQueryDataView
        - uses the above classes to create the required
          Query -> DataSource -> Pipeline -> Report connection
        - uses the TdaSQL object built by the QueryWizard to assign
          SQL to the TODBCQuery etc.



Installing
-----------

1. The pascal unit and package source files have been tested with a trial version of ODBC98 for Delphi 3. We were unable to install ODBC98 for Delphi 4 because it requires that you install the patches for Delphi 4 available from Inprise. However, once you are able to install ODBC98 there should not be a problem compiling our source code.

2. Contents of the source

 a. daODBC98.pas - source code to data view class
 b. dclRB044.dpk - source package that contains the daODBC98.pas unit


3. Copy the above files to your ..\RBuilder Pro 4\Lib directory.

4. To use the ODBC98 DataView at run time, add daODBC98 to the 'uses' clause of the form that contains the TppDesigner component.


5. To use the ODBC98 DataView at design time, compile the package. A .dpl and .dcp file will be produced (or a .bpl and .dcp for Delphi 4.) Install the resulting .dpl file into the Delphi IDE. 

6. Move the source .pas and .dpk files to the ..\RBuilder\Pro 4\Source directory.
















