Using Direct Access Components
 
Using Direct Access Components
Information on Using the PSQL Replacement for the Embarcadero Database Engine
The following topics introduce the PSQL Direct Access Components for Delphi and C++ Builder:
Overview of PSQL Direct Access Components
Using the PSQL Direct Access Components
Deploying an Application Based on PDAC
For details on implementing this feature, see Direct Access Components Reference.
Overview of PSQL Direct Access Components
The PSQL Direct Access Components (PDAC) is a set of Visual Component Library (VCL) components that allow direct access to PSQL database engines from within the Embarcadero Delphi and C++ Builder Environments. These components offer a complete replacement for the Borland Database Engine (BDE), while providing the complete functionality of the BDE. PDAC dramatically extends the database development options available to Delphi and C++ Builder developers.
Refer to the PDAC readme file for the development environments supported by the PSQL Direct Access Components.
All versions of PDAC contain the following nonvisual components:
TPvSession
TPvDatabase
TPvTable
TPvBatchMove
TPvQuery
TPvStoredProc
TPvUpdateSQL
TPvSqlDatabase
Supporting classes are also provided for these components.
These 32-bit components duplicate the properties, methods, and binding capabilities of the Embarcadero Data Access components, but 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 checks for an adequate PSQL engine version to ensure that engine dependency-related errors do not occur. If the engine version is not sufficient, an exception is thrown with a message indicating the required version.
TPvQuery.PassThrough
Allows SQL 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 SDK Downloads for sample code and code snippets for the PSQL Direct Access Components. You can find the online location for SDK Downloads for PDAC at the Actian PSQL website.
Using the PSQL Direct Access Components
You install the PDAC components by unzipping the components from an archive to a directory of your choice (installdir). You must ensure that any Delphi or C++ Builder IDEs on your system can locate the components after they are unzipped.
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 PSQL components.
To add PSQL Direct Access Components to the INCLUDE and LIBRARY paths in C++ Builder
1 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 2006, Delphi 2007 and C++ Builder 2007
PSQL provides support for Delphi 2006 and Delphi 2007 and for C++ Builder 2007. Use the following steps to incorporate Delphi 2006, Delphi 2007, or C++ Builder 2007 into your environment.
To add the Delphi 2006, Delphi 2007, or C++ Builder 2007 packages and path information to your environment.
1 Click Components > Install Packages > Add.
2 Select the design packages.
3 Add the paths to the Delphi compiled units (DCUs) and interface files (INTs).
Since Delphi 2007 and C++ Builder 2007 are binary compatible with Delphi 2006 (BDS 2006), all of your existing Embarcadero package libraries (BPLs) should work without any modification. Note that Delphi 2007 and C++ Builder 2007 declare compiler variable VERSION_180 and VERSION_185.
RAD Studio
Follow these steps to add components to the compiler IDE for the following editions of RAD studio:
RAD Studio 2009
RAD Studio 2010
RAD Studio XE
RAD Studio XE2 (32-bit only)
RAD Studio XE3
RAD Studio XE4
RAD Studio XE5
RAD Studio XE6
RAD Studio XE7
RAD Studio XE8
RAD Studio 10
RAD Studio 10.1
RAD Studio 10.2
To add the RAD Studio packages and path information to your environment
1 Click Components > Install Packages > Add.
2 Browse to the following PDAC design time components and select the ones you need. Note that these are design time packages. For run time, see Deploying an Application Based on PDAC.
RAD Studio 2009 Components
pc200d2009.bpl
pb200d2009.bpl
ps200d2009.bpl
RAD Studio 2010 Components
pc200d2010.bpl
pb200d2010.bpl
ps200d2010.bpl
RAD Studio XE Components
pc200dXE.bpl
pb200dXE.bpl
ps200dXE.bpl
RAD Studio XE2 Components (IDE supports 32-bit only)
pc200dXE2.bpl
pb200dXE2.bpl
ps200dXE2.bpl
RAD Studio XE3 Components (IDE supports 32-bit only)
pc200dXE3.bpl
pb200dXE3.bpl
ps200dXE3.bpl
RAD Studio XE4 Components (IDE supports 32-bit only)
pc200dXE4.bpl
pb200dXE4.bpl
ps200dXE4.bpl
RAD Studio XE5 Components (IDE supports 32-bit only)
pc200dXE5.bpl
pb200dXE5.bpl
ps200dXE5.bpl
RAD Studio XE6 Components (IDE supports 32-bit only)
pc200dXE6.bpl
pb200dXE6.bpl
ps200dXE6.bpl
RAD Studio XE7 Components (IDE supports 32-bit only)
pc200dXE7.bpl
pb200dXE7.bpl
ps200dXE7.bpl
RAD Studio XE8 Components (IDE supports 32-bit only)
pc200dXE8.bpl
pb200dXE8.bpl
ps200dXE8.bpl
RAD Studio 10 Components (IDE supports 32-bit only)
pc200d10.bpl
pb200d10.bpl
ps200d10.bpl
RAD Studio 10.1 Components (IDE supports 32-bit only)
pc200d101.bpl
pb200d101.bpl
ps200d101.bpl
RAD Studio 10.2 Components (IDE supports 32-bit only)
pc200d102.bpl
pb200d102.bpl
ps200d102.bpl
Once the components for your environment have been selected, a tab for PSQL 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 regarding the Embarcadero and other runtime libraries, there are two basic ways to build PDAC applications for deployment to end users: using runtime packages or statically linking the PDAC libraries into the application's executable file. C++ Builder also offers the option of dynamically or statically linking the Embarcadero runtime library.
Note The SDK-supplied file drm.dll (from the PSQL installation BIN directory after an SDK installation) must be installed into the path in all deployment configurations, and either a PSQL Client or a PSQL engine (Server or Workgroup) must be properly installed on the target computer for a PDAC application to run.
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 appropriate PDAC libraries (from the redist subdirectories in the PDAC installation directories), 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
There is a redist directory for each Embarcadero compiler. 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.
IDS Deployment
PDAC applications cannot be used with I*net Data Server (IDS). IDS is no longer a separately installable component of PSQL. Most features that were part of IDS are now integrated into the main product.
Building and Deployment Instructions for Delphi or C++ Builder
The following instructions are for building and deploying with the following versions:
Delphi 2006
C++ Builder 2007
Delphi 2007
RAD Studio 2009
RAD Studio 2010
RAD Studio XE
RAD Studio XE2 (32 bit)
RAD Studio XE3 (32- and 64-bit)
RAD Studio XE4 (32- and 64-bit)
RAD Studio XE5 (32- and 64-bit)
RAD Studio XE6 (32- and 64-bit)
RAD Studio XE7 (32- and 64-bit)
RAD Studio XE8 (32- and 64-bit)
RAD Studio 10 (32- and 64-bit)
RAD Studio 10.1 (32- and 64-bit)
RAD Studio 10.2 (32- and 64-bit)
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, as follows:
Note If the PDAC packages were added to the Build list at installation, this step is not necessary.
The following table lists runtime packages (.bpl files) required for the MicroKernel Engine depending on your version of Delphi.
 
Table 1 Runtime Packages Required for MicroKernel Engine Components
Delphi Version
Runtime Packages Required1
Delphi 2006 and Delphi 2007
pc200d2006 and pb200d2006
RAD Studio 2009
pc200r2009 and pb200r2009
RAD Studio 2010
pc200r2010 and pb200r2010
RAD Studio XE
pc200rXE and pb200rXE
RAD Studio XE2 (32-bit)
pc200rXE2 and pb200rXE2
RAD Studio XE3 (32-bit)2
pc200rXE3 and pb200rXE3
RAD Studio XE3 (64-bit)2
w64pc200rXE3 and w64pb200rXE3
RAD Studio XE4 (32-bit)2
pc200rXE4 and pb200rXE4
RAD Studio XE4 (64-bit)2
w64pc200rXE4 and w64pb200rXE4
RAD Studio XE5 (32-bit)2
pc200rXE5 and pb200rXE5
RAD Studio XE5 (64-bit)2
w64pc200rXE5 and w64pb200rXE5
RAD Studio XE6 (32-bit)2
pc200rXE6 and pb200rXE6
RAD Studio XE6 (64-bit)2
w64pc200rXE6 and w64pb200rXE6
RAD Studio XE7 (32-bit)2
pc200rXE7 and pb200rXE7
RAD Studio XE7 (64-bit)2
w64pc200rXE7 and w64pb200rXE7
RAD Studio XE8 (32-bit)2
pc200rXE8 and pb200rXE8
RAD Studio XE8 (64-bit)2
w64pc200rXE8 and w64pb200rXE8
RAD Studio 10 (32-bit)2
pc200r10 and pb200r10
RAD Studio 10 (64-bit)2
w64pc200r10 and w64pb200r10
RAD Studio 10.1 (32-bit)2
pc200r101 and pb200r101
RAD Studio 10.1 (64-bit)2
w64pc200r101 and w64pb200r101
RAD Studio 10.2 (32-bit)2
pc200r102 and pb200r102
RAD Studio 10.2 (64-bit)2
w64pc200r102 and w64pb200r102
1 The Btrieve components include TPvSession, TPvDatabase, TPvTable, TPvBatchMove, and TwwPvTable. See MicroKernel Engine Components.
2 Requires the latest update for PSQL v13.
The following table lists the runtime packages (.bpl files) required for the Relational Engine depending on your version of Delphi.
 
Table 2 Runtime Packages Required for Relational Engine Components
Delphi Version
Runtime Packages Required1
Delphi 2006 and Delphi 2007
pc200d2006 and ps200d2006
RAD Studio 2009
pc200r2009 and ps200r2009
RAD Studio 2010
pc200r2010 and ps200r2010
RAD Studio XE
pc200rXE and ps200rXE
RAD Studio XE2 (32-bit)
pc200rXE2 and ps200rXE2
RAD Studio XE3 (32-bit)2
pc200rXE3 and ps200rXE3
RAD Studio XE3 (64-bit)2
w64pc200rXE3 and w64ps200rXE3
RAD Studio XE4 (32-bit)2
pc200rXE4 and ps200rXE4
RAD Studio XE4 (64-bit)2
w64pc200rXE4 and w64ps200rXE4
RAD Studio XE5 (32-bit)2
pc200rXE5 and ps200rXE5
RAD Studio XE5 (64-bit)2
w64pc200rXE5 and w64ps200rXE5
RAD Studio XE6 (32-bit)2
pc200rXE6 and ps200rXE6
RAD Studio XE6 (64-bit)2
w64pc200rXE6 and w64ps200rXE6
RAD Studio XE7 (32-bit)2
pc200rXE7 and ps200rXE7
RAD Studio XE7 (64-bit)2
w64pc200rXE7 and w64ps200rXE7
RAD Studio XE8 (32-bit)2
pc200rXE8 and ps200rXE8
RAD Studio XE8 (64-bit)2
w64pc200rXE8 and w64ps200rXE8
RAD Studio 10 (32-bit)2
pc200r10 and ps200r10
RAD Studio 10 (64-bit)2
w64pc200r10 and w64ps200r10
RAD Studio 10.1 (32-bit)2
pc200r101 and ps200r101
RAD Studio 10.1 (64-bit)2
w64pc200r101 and w64ps200r101
RAD Studio 10.2 (32-bit)2
pc200r102 and ps200r102
RAD Studio 10.2 (64-bit)2
w64pc200r102 and w64ps200r102
1 The Relational components include TPvSQLSession, TPvSQLDatabase, TPvQuery, TPvUpdateSQL, TPvSQLStoredProc, TwwPvQuery, and TwwPvSQLStoredProc. See Relational Engine Components.
2 Requires the latest update for PSQL v13.
To select packages, click Components > Install, and select the packages from the directory that matches your version of Delphi. All the packages may be selected at once.
 
Delphi Version
Directory (used for default installation)
Delphi 2006
Delphi 2007
\SDK\PDAC\Delphi2006\LIB
RAD Studio 2009
\SDK\PDAC\Delphi2009\LIB
RAD Studio 2010
\SDK\PDAC\Delphi2010\LIB
RAD Studio XE
\SDK\PDAC\DelphiXE\LIB
RAD Studio XE2 (32 bit)
\SDK\PDAC\DelphiXE2\LIB
RAD Studio XE3 (32-bit)
\SDK\PDAC\DelphiXE3\x86\LIB
RAD Studio XE3 (64-bit)
\SDK\PDAC\DelphiXE3\x64\LIB
RAD Studio XE4 (32-bit)
\SDK\PDAC\DelphiXE4\x86\LIB
RAD Studio XE4 (64-bit)
\SDK\PDAC\DelphiXE4\x64\LIB
RAD Studio XE5 (32-bit)
\SDK\PDAC\DelphiXE5\x86\LIB
RAD Studio XE5 (64-bit)
\SDK\PDAC\DelphiXE5\x64\LIB
RAD Studio XE6 (32-bit)
\SDK\PDAC\DelphiXE6\x86\LIB
RAD Studio XE6 (64-bit)
\SDK\PDAC\DelphiXE6\x64\LIB
RAD Studio XE7 (32-bit)
\SDK\PDAC\DelphiXE7\x86\LIB
RAD Studio XE7 (64-bit)
\SDK\PDAC\DelphiXE7\x64\LIB
RAD Studio XE8 (32-bit)
\SDK\PDAC\DelphiXE8\x86\LIB
RAD Studio XE8 (64-bit)
\SDK\PDAC\DelphiXE8\x64\LIB
RAD Studio 10 (32-bit)
\SDK\PDAC\Delphi10\x86\LIB
RAD Studio 10 (64-bit)
\SDK\PDAC\Delphi10\x64\LIB
RAD Studio 10.1 (32-bit)
\SDK\PDAC\Delphi101\x86\LIB
RAD Studio 10.1 (64-bit)
\SDK\PDAC\Delphi101\x64\LIB
RAD Studio 10.2 (32-bit)
\SDK\PDAC\Delphi102\x86\LIB
RAD Studio 10.2 (64-bit)
\SDK\PDAC\Delphi102\x64\LIB
Note If the PDAC packages are not added to the list, they will be compiled into the executable and the shared libraries will not be used, even if the box is checked.
To statically link the PDAC libraries into the application executable, clear Build with runtime packages.
If Build with runtime packages is checked at compile time, the following libraries must be installed when the application is deployed, in addition to the application itself, drm.dll, and any other packages or DLLs it requires.
Delphi 2006/Delphi 2007 Package Build List
From \SDK\PDAC\Delphi2006\REDIST, if their respective .dcp files are in the package build list:
pc200d2006.bpl
pb200d2006.bpl
ps200d2006.bpl
RAD Studio 2009 Package Build List
pc200r2009.bpl
pb200r2009.bpl
ps200r2009.bpl
RAD Studio 2010 Package Build List
pc200r2010.bpl
pb200r2010.bpl
ps200r2010.bpl
RAD Studio XE Package Build List
pc200rXE.bpl
pb200rXE.bpl
ps200rXE.bpl
RAD Studio XE2 (32-bit) Package Build List
pc200rXE2.bpl
pb200rXE2.bpl
ps200rXE2.bpl
RAD Studio XE3 (32-bit) Package Build List
pc200rXE3.bpl
pb200rXE3.bpl
ps200rXE3.bpl
RAD Studio XE3 (64-bit) Package Build List
w64pc200rXE3.bpl
w64pb200rXE3.bpl
w64ps200rXE3.bpl
RAD Studio XE4 (32-bit) Package Build List
pc200rXE4.bpl
pb200rXE4.bpl
ps200rXE4.bpl
RAD Studio XE4 (64-bit) Package Build List
w64pc200rXE4.bpl
w64pb200rXE4.bpl
w64ps200rXE4.bpl
RAD Studio XE5 (32-bit) Package Build List
pc200rXE5.bpl
pb200rXE5.bpl
ps200rXE5.bpl
RAD Studio XE5 (64-bit) Package Build List
w64pc200rXE5.bpl
w64pb200rXE5.bpl
w64ps200rXE5.bpl
RAD Studio XE6 (32-bit) Package Build List
pc200rXE6.bpl
pb200rXE6.bpl
ps200rXE6.bpl
RAD Studio XE6 (64-bit) Package Build List
w64pc200rXE6.bpl
w64pb200rXE6.bpl
w64ps200rXE6.bpl
RAD Studio XE7 (32-bit) Package Build List
pc200rXE7.bpl
pb200rXE7.bpl
ps200rXE7.bpl
RAD Studio XE7 (64-bit) Package Build List
w64pc200rXE7.bpl
w64pb200rXE7.bpl
w64ps200rXE7.bpl
RAD Studio XE8 (32-bit) Package Build List
pc200rXE8.bpl
pb200rXE8.bpl
ps200rXE8.bpl
RAD Studio XE8 (64-bit) Package Build List
w64pc200rXE8.bpl
w64pb200rXE8.bpl
w64ps200rXE8.bpl
RAD Studio 10 (32-bit) Package Build List
pc200r10.bpl
pb200r10.bpl
ps200r10.bpl
RAD Studio 10 (64-bit) Package Build List
w64pc200r10.bpl
w64pb200r10.bpl
w64ps200r10.bpl
RAD Studio 10 .1 (32-bit) Package Build List
pc200r101.bpl
pb200r101.bpl
ps200r101.bpl
RAD Studio 10.1 (64-bit) Package Build List
w64pc200r101.bpl
w64pb200r101.bpl
w64ps200r101.bpl
RAD Studio 10.2 (32-bit) Package Build List
pc200r102.bpl
pb200r102.bpl
ps200r102.bpl
RAD Studio 10.2 (64-bit) Package Build List
w64pc200r102.bpl
w64pb200r102.bpl
w64ps200r102.bpl
These files may be installed in the same subdirectory as the application executable, but we recommend placing them in the target machine path so they may be shared by other applications. The PSQL installation \bin directory is a good choice on computers where it is the primary PSQL executable directory.
In addition, the Delphi PDAC application will require an installation of either a PSQL engine (Server or Workgroup) or a PSQL 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 shows how to interpret the runtime package names if you are coming from a previous version of Delphi and PDAC:
pc200r60.bpl
pb200r60.bpl
ps200r60.bpl
 
File name digit position
Possible values
Meaning
1
p
PSQL
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 Starting with Delphi 6, InfoPower functionality has been merged into the main packages. There are no longer separate packages for InfoPower Woll2Woll components.