PreviousPDAC Programmer's Guide (9.1 revision 1) Next

Overview of Pervasive Direct Access Components for Delphi and C++ Builder

Show this topic in Library frames

The Pervasive Data Access Components (PDAC) is a set of Visual Component Library (VCL) components that allow direct access to Pervasive Database Engines from within the Borland 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.

The Pervasive Data Access Components are provided in versions fully integrated with the following development environments:

Compatibility with later versions of the Delphi and C++ Builder development tools will be made available after those products are released by Borland.

No support is provided or planned for the following:

All versions of PDAC contain the non-visual components TPvSession, TPvDatabase, TPvTable, TPvBatchMove, TPvQuery, TPvStoredProc, TPvUpdateSQL, and TPvSqlDatabase with supporting classes for these components. These 32-bit components duplicate the properties, methods, and binding capabilities of the Borland 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 run time functionality of the built-in controls. They will bind to the Borland Data Aware controls in the same way as the BDE components, as well as to fully compatible third-party bound controls. Special components (wwPvTable, wwPvQuery, wwPwStoredProc) are provided for interoperability with the Woll2Woll InfoPower components. TPvTable, TPvDatabase, TPvBatchMove, and TPvSession make up the "Btrieve subset" of the full PDAC set; these components use no relational functionality, and do not require the Pervasive.SQL Relational Engine or ODBC at runtime. TPvQuery, TPvStoredProc, TPvUpdateSQL, and TPvSqlDatabase components use Pervasive.SQL's underlying relational functionality.


Note
Since the Pervasive components duplicate the Borland properties and methods, refer to your Borland documentation for reference material on specific properties and methods.

The components included and the Borland components they clone:

Pervasive Direct Access Component
Replaces This Borland Component
TPvSession
TSession
TPvDatabase
TDatabase
TPvTable, TwwPvTable
TTable
TPvBatchMove
TBatchMove
TPvSqlSession
TSession
TPvSqlDatabase
TDatabase
TPvQuery, TwwPvQuery
TQuery
TPvStoredProc, TwwPvStoredProc
TStoredProc
TPvUpdateSQL
TUpdateSQL

The following table shows the functionality of these components

Pervasive Component
Functionality
TPvSession
Provides thread safety and Client ID support. Its functionality is similar to the TSession VCL component.
TPvDatabase
Provides database connection-specific functionality for non-SQL databases, such as login control, transaction support, persistent database connections. Its functionality is similar to the TDatabase VCL component.
TPvTable
Provides single-table access and manipulation. Its functionality is similar to the TTable VCL component.
TPvBatchMove
Enables applications to perform database operations on groups of records or entire tables. Its functionality is similar to the TBatchMove VCL component.
TPvSqlSession
Provides thread safety and Client ID support for Pervasive.SQL. Functionality is similar to the TSession VCL component.
TPvSqlDatabase
Provides for Pervasive.SQL database connection-specific functionality, such as login control, transaction support and persistent database connections. Functionality is similar to the TDatabase VCL component.
TPvQuery
Encapsulates a rowset based on a SQL statement; this provides full relational access including joins and cached updates to multiple tables. Functionality is similar to the TQuery VCL component.
TPvStoredProc
Provides access to Pervasive.SQL stored procedures; it allows parameterized use and can return rowsets the same as the TPvQuery component. Functionality is similar to TStoredProc VCL component.
TPvUpdateSQL
Allows transparent updating (including cached updates) of SQL rowsets not otherwise updateable (multiple-table joins, etc.). Functionality is similar to TUpdateSQL VCL component.
TwwPvTable, TwwPvQuery, and TwwPvStoredProc
Included with PDAC for InfoPower compatibility. They are directly derived from TPvTable, TPvQuery, and TPvStoredProc. They each have one extra property, "Control Type".

The components can be used standalone (that is, without the Borland Database Engine installed) or coincident with the Borland Database Engine (BDE) within a single application. Use of the components is the same as the corresponding BDE components, with exceptions noted in PDAC Classes, Properties, Events, and Methods in Chapter 2, Direct Access Components Reference.

New in Pervasive.SQL V8 (v8.5)

This release includes the following updates:

BookMarksEnabled Property Added to TPvQuery

A new Boolean property "BookmarksEnabled" was added to TPvQuery. If you do not use Bookmarks in your application, set this property to False in order to increase TPvQuery performance. The default value is True.

PvQuery.BookmarksEnabled :=False 

Secure Databases and PDAC

If you are connecting to a secured database, PDAC prompts you for the user name and password. If you do not want the user to be prompted for the user name and password, you can set up the connection parameters in TPvDatabase and TPvSQLDatabase.

For example:

   PvSession.ServerName:='ServerName'; 
   PvSession.SessionName:='session1'; 
   PvSession.Active:=True; 
   PvDatabase.AliasName:= 'DatabaseName'; 
   PvDatabase.DatabaseName:='DB'; 
   PvDatabase.SessionName:='session1'; 
   PvDatabase.Params.Clear(); 
// here you specify user name and password to  
// connect to remote database. 
   PvDatabase.Params.Add('User Name=UserName'); 
   PvDatabase.Params.Add('password=Password'); 
   PvDatabase.Connected:=True; 
   PvTable.DatabaseName:='DB'; 
   PvTable.SessionName:='session1'; 
   PvTable.TableName:='person'; 
   PvTable.Active:=True; 

New in Pervasive.SQL V8 (v8.0)

This release incorporates a number of fixes for reported issues, and introduces new functionality with regards to cursors.

Other than the issues discussed in this section, PDAC should operate as it did in prior releases. However, it will exhibit faster relational performance. If you have existing PDAC applications that have issues with this new release, please contact Pervasive Software with this information.

Support for newer Borland releases

This release now supports the following:

TPvTable & other Btrieve components

There are no functional changes to these components, but there are several issues resolved.

TPvQuery

TPvQuery has a new property CursorType. This property can be set to ctCached or ctDynamic. The following table describes the behavior of this property in more detail:

Cursor type
Behavior
ctCached
This setting corresponds to the previously-available fully-cached, fully-static Cursor Manager. It reads every record in the ResultSet before returning, which can be very slow for large tables, yet fast after it has opened for operations such as LookUps.
ctDynamic
This setting is the new default; it uses the Pervasive.SQL Engine's dynamic cursors, and offers much improved performance for most operations when compared with ctCached, especially with regard to large tables.


Note
Dynamic cursors can see the Inserts/Updates/Deletes of their own or other clients.

You can change CursorType on a PvQuery by changing the Property, but only (at runtime) if Active is False. If you change it in Design mode, and the query is Active, it will de-activate the query and change the cursortype (but not reactivate). At Runtime, changing CursorType on an Active PvQuery will throw an exception ("Cannot perform this operation on an open dataset").

Case Where Dynamic Cursors Change to Static

If you request a Dynamic cursor (ctDynamic), but your SQL statement contains a construct that a Dynamic cursor cannot process, the engine will connect and return data, but with a Static cursor. For example, such a construct could be:

In the event the cursor is transformed into a static one, this static cursor will be engine-based one that cannot see inserts, updates, or deletes made by other clients. It will perform better than the static cursors on previous releases (that is, ones using ctCached as the cursor type.).

When the dynamic to static transformation occurs, the Pervasive.SQL engine notifies the PDAC component, and sets a read-only Public Property named EngineCursor.

This EngineCursor property is not published, so it is not visible in the Object Inspector during design. It can have two values:

You cannot modify this property, but you can check its value after opening a query. You might want to check this property for example if it is important that your application know whether your cursor includes updates made by other clients.

Engine Version Checking

When opening a query or table, PDAC now checks for an adequate Pervasive.SQL 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.

New in Pervasive.SQL 2000i

Two new properties were added with Pervasive.SQL 2000i. See Specific Class Differences from VCL for more information.


Chapter contents
Publication contents

Prev topic: Using Direct Access Components
Next topic: Using the Pervasive Direct Access Components