Developer Reference > Data Access Methods > Zen Direct Access Components (PDAC) Guide > Using Direct Access Components
Using Direct Access Components
The following topics introduce Zen Direct Access Components (PDAC) for Delphi and C++Builder:
For details on implementing this feature, see Direct Access Components Reference.
Overview of Zen Direct Access Components
Zen Direct Access Components are a set of Visual Component Library (VCL) components that allow direct transactional and relational access to Zen database engines from within the Borland Delphi and C++ Builder Environments. This SDK was formerly known as Pervasive Direct Access Components (PDAC), and the short name PDAC is still found in use in the SDK. Before the Zen v15 release, these runtime components were integrated and installed as .bpl files in the 32- and 64-bit \bin directories of Zen databases. Beginning with Zen v15, Zen installations removed them, but they continue to be available in the downloaded SDK, which also includes design-time components for use in RAD Studio.
See the PDAC release notes for supported development environments.
All versions of PDAC contain the following nonvisual components:
TPvSession
TPvDatabase
TPvTable
TPvBatchMove
TPvQuery
TPvStoredProc
TPvUpdateSQL
TPvSqlDatabase
Supporting classes are also provided for these 32-bit components, which duplicate the properties, methods, and binding capabilities of the Embarcadero Data Access components without requiring the presence of the Borland Database Engine (BDE) at run time.
These components are provided in package format, and offer all the design time and runtime functionality of the built-in controls. They bind to the Embarcadero Data Aware controls in the same way as the BDE components, as well as to fully compatible third-party bound controls.
Special components include wwPvTable, wwPvQuery, and wwPvStoredProc and are provided for interoperability with the Woll2Woll InfoPower components.
Engine Version Checking
When opening a query or table, PDAC confirms the database engine version to avoid engine dependency errors. An insufficient engine version returns an exception indicating the required version.
TPvQuery.PassThrough
Allows SQL query text to be sent directly to the engine instead of being preparsed.
TPvDatabase.OEMConversion
This property indicates that the database contains characters encoded according to the OEM (DOS) code page, and that these characters should be converted to the ANSI (Windows) code page before use.
Where to Get More Information
Please see the SDK download for PDAC. You can find it at the Actian Zen website.
Using the Zen Direct Access Components
You install PDAC by extracting the components from a download archive to a directory (installdir). Be sure that any Delphi or C++Builder IDEs on your system can locate the extracted components.
Follow these steps to set C++Builder project options to reflect the INCLUDE and LIBRARY paths for PDAC. These can be added to the default options, so the steps are unnecessary for every project using the Zen components.
To add PDAC to the INCLUDE and LIBRARY paths in C++Builder
1. In C++Builder, select Project > Options, and choose the Directories/Conditionals tab.
2. Add installdir\sdk\pdac\Delphi?\include to the Include Path, where installdir represents the directory where you installed the SDK. Replace the question mark with the version of RAD Studio you are using.
3. Also add installdir\sdk\pdac\Delphi?\lib and installdir\sdk\pdac\Delphi?\lib\dcu to the Library Path, separated by a semicolon. Replace the question mark with the version of RAD Studio you are using.
After the Include and Library paths are set properly, you can use the Direct Access components in exactly the same way as the corresponding Embarcadero components.
Delphi and C++Builder
Zen provides support for all Delphi versions starting with Delphi 6. Use the following steps to incorporate Delphi or C++Builder into your IDE.
To add the Delphi or C++Builder packages and path information to your environment
1. In Delphi or C++Builder, select Components > Install Packages > Add.
2. Select the design packages.
3. Add the paths to the Delphi compiled units (DCUs) and interface files (INTs).
Once the components for your environment have been selected, a tab for Zen is visible on VCL projects. Applications using PDAC can now be built by adding PvTable or PvQuery.
Deploying an Application Based on PDAC
With a few variations for Embarcadero and other runtime libraries, you can build PDAC applications for deployment to end users in two ways: using runtime packages or statically linking the PDAC libraries in the application executable. C++Builder also offers dynamic or static linking of the Embarcadero library. Either a Zen Client or engine (Enterprise Server, Cloud Server, or Workgroup) must be properly installed on the target computer for a PDAC application to run successfully.
Deciding Whether to Use Runtime Packages
Using runtime packages has several advantages. It provides the smallest executable possible; this can be important where the executable or updates must be downloaded or transferred over slow links. This option allows sharing of the PDAC and Embarcadero runtime binaries and can save considerable disk space and memory in environments with many Embarcadero and PDAC applications.
A disadvantage is that more files must be distributed and kept current, and the shared files can be vulnerable to third party installations that install incorrect versions of them in shared subdirectories. If runtime packages are not used, only the application and drm.dll must be deployed. The PDAC libraries are statically linked into the executable, which will be correspondingly larger.
To use runtime packages, the developer must deploy both the application executable and the PDAC libraries (from the redist subdirectories in the PDAC installation), as well as any Embarcadero or other runtime libraries (borlndmm.dll, found in the compiler bin directory, is often needed) to end users.
Redist Subdirectory
Each Embarcadero compiler has a redist directory. This directory contains the .bpl libraries that must be distributed with an application compiled with Build with runtime packages.
Note:  Each redist directory also includes .dcp or .bcp files that are not redistributable except within the licensee's organization to allow development with derived classes. Only the .dpl and .bpl packages may be distributed with applications.
Building and Deployment Instructions for Delphi or C++Builder
In the Delphi IDE, set the appropriate options as follows:
1. From the menu bar, select Project > Options
2. Click the Packages tab.
To have the application dynamically link with the PDAC libraries at run time, select Build with runtime packages, and add the appropriate PDAC packages to the edit box list.
Note:  If the PDAC packages were added to the Build list at installation, this step is not necessary.
3. Select the 32- or 64-bit runtime packages (.bpl files) required for the MicroKernel Engine depending on your version of Delphi.
Note:  If the PDAC packages are not added to the list, they are compiled into the executable and the shared libraries are not used, even if the box is selected.
4. To statically link the PDAC libraries into your executable, clear the Build with runtime packages check box. If you select this setting at compile time, then you must install the libraries when you deploy the application and any other packages or DLLs required.
These files may be installed in the same subdirectory as the application executable, but we recommend placing them in the target machine path to be shared by other applications. The Zen installation \bin directory is a good choice on computers where it is the primary Zen executable directory.
In addition, the Delphi PDAC application will require an installation of either a Zen engine (server or workgroup) or a Zen Client and a remote server appropriately installed and configured.
Updated Package Names Starting with Delphi 6
Starting with Delphi 6, we have changed the package naming conventions to be more compatible with Embarcadero standards. Also, the runtime packages have been separated from the design time packages in order to comply with Embarcadero requirements.
The following table shows how to interpret package names if you are coming from a previous version of Delphi and PDAC:
File name digit position
Possible values
Meaning
1
p
PSQL (former name for Zen product)
2
c, b, or s
Common, Btrieve, or SQL
3–5
depends on release
Major and minor version of PDAC components
6
r, d
Run time or design time
7–9
depends on release
Delphi version to which these components apply
Note:  In Delphi 6, InfoPower merges into the main packages, with Woll2Woll no longer separate.
Last modified date: 10/31/2023