Btrv++ v3.5

The Most Powerful and Portable Object-Oriented interface to Btrieve and Pervasive SQL available

Btrv++ class hierarchy

Comprehensive and Time Tested

Btrv++ v3.5 is a class library for Btrieve that is comprehensive and time-tested. It is the most powerful and portable C++ interface to Btrieve available anywhere. Version 3.5 includes enhancements to our SQL query processor and supports all versions of Visual C++ and Borland Borland Compilers. The class library fully supports Win32 and is fully multithreaded.

Btrv++ is truly portable. It is 100% source code compatible across Win32, Win32s, Windows 3.1, DOS and OS/2 16 and 32 bit. It supports all versions of Btrieve and Pervasive SQL across all major operating platforms. Btrv++ even includes thunk layers for calling 16 bit Btrieve from Windows 95, 98 and Win32s. Btrv++ supports all major compilers, Microsoft, Borland, Symantec, and IBM.

Under Windows Btrv++ not only comes as a static library but also as a DLL. In addition Btrv++ also contains a pure C interface to the class library. This allows you to get object-oriented access via a straight C interface but also to allows you to call the library from any application supporting a DLL. Interface files for DLL access are provided for Visual Basic and Delphi.

Btrv++ not only provides low level object access to Btrieve but contains numerous value added classes and member functions for file and index creation, extended operations, and Chunk operations. It even includes a SQL interface to the Btrieve extended operations. With Btrv++ you can easily achieve a 10:1 reduction in code and complexity compared to using the standard Btrieve API from the Btrieve development kit. Below are just a few of the features available with Btrv++.

  • Btrv++ gives you full access to all of the capabilities of Btrieve and Pervasive SQL 5-8 and 2000 as a set of member functions. Btrv++ manages the position block and all bookkeeping required between calls.
  • SQL interface to the Btrieve Extended operations.
  • Field based access via Btrieve DDF files.
  • A complete set of data conversion routines for all Btrieve data types.
  • C\C++ access to Btrieve DDF files.
  • Built in scrolling support with virtual list capability. Easily bind your data to controls like scroll bars, list boxes and grids.
  • Ability to perform complex find operations using SQL syntax including support for the LIKE operator
  • Data and key buffer management.
  • A set of classes for easy file and index creation.
  • A set of classes for creating and interpreting the complex buffers required for Btrieve extended operations.
  • A class for creating and interpreting the complex buffers required for Btrieve chunk operations.
  • Simplified multi-user locking and transactions.
  • Standard C interface via a Windows DLL (16 and 32 bit).
  • Member functions to perform file like Read, Write and Seek operations on large Btrieve records.
  • 32 bit support for all 32 bit Windows OS platforms.
  • Support for DOS, Win32s, and OS/2.

Btrv++ Hides Btrieve's Implementation Details

Btrv++ transparently manages the position block, data buffers, key buffers, and the current key. Saving and restoring position are accomplished with a one-line call each to a member function. All Btrieve constants and data structures are defined for you. A complete set of data conversion routines are provided for all Btrieve data types. Field based access is provided for via Btrieve DDF files. The SQL processor maps to Btrieve extended operations providing a simple and natural interface to the most difficult, complicated (yet fastest) operations of Btrieve.

Btrv++ Exploits The Full Power Of C++

Through inheritance, one object class is all you need to write complete Btrieve applications. Or derive your own classes using Btrv++'s classes as base classes, and add your own application-specific data and functions on top of Btrv++'s rich functionality.

Classic Software, Inc. has developed a product to let you take full advantage of C++ inheritance and build onto Btrv++ rich functionality with the minimum of effort. The product is called Btrvgen++, a class code generator for our Btrv++ class library. Btrvgen++ is a visual program that provides you the ability to design your Btrieve files and relationships and then generate a specific class library representation of your database. It generates classes, structures and access functions for your data. Btrv++ also includes an integrated DDF file editor and can generate classes off of an existing DDF!

Complete documentation, on-line help and numerous sample programs are provided. Btrv++ comes with complete source code. And best of all Btrv++ is royalty-free!

Btrv++ Takes Your Productivity To The Limit Without Sacrificing Performance

With Btrv++ you can achieve order of magnitude productivity gains in development without sacrificing run-time performance. You get complete control over indexing and keys, variable length record support, and a SQL query interface that provides anywhere from 10 to 50 times regular Btrieve access.

Btrv++ Architecture

The Btrv++ library is composed of over a dozen major classes (classes with public interfaces) and several private helper classes. The classes contain well over 100 member functions providing many value added capabilities. Btrv++ makes use of inheritance and heavy reuse of lower level class member functions, just like any object library should. The class hierarchy is shown at the top of this page. A brief description of the classes follows.

  • BTRVOAPI. This class provides the base object interface to Btrieve. It encapsulates the Btrieve position block and manages all of the bookkeeping required between calls to Btrieve. It implements ALL Btrieve operations as a set of member functions. It also contains many valued added member functions for cloning files, saving and restoring your position, etc.
  • BTRVCRE. This class hides all of the messy details for creating and editing the complex buffers required by Btrieve for file and index creation .
  • BTRVCHUNK. This class hides all of the messy details for creating, editing, and interpreting the complex and variable sized buffers required by Btrieve chunk operations.
  • EXTEND. This class hides all of the messy details for creating, editing, and interpreting the complex and variable sized buffers required by Btrieve extended operations.
  • BTRVOBJ. This class uses inheritance to integrate the capabilities of the BTRVOAPI, EXTEND, BTRVCRE, and BTRVCHUNK classes. It overloads the BTRVOAPI Extended, Chunk, And File and index creation member functions to make use of the capabilities of the inherited classes.
  • BTRVDBOBJ. This class adds data and key buffer management. It internally manages the record buffer for access to Btrieve. It will also manage the key buffers required for key searches. It Provides true QBE query capabilities by creating key buffers directly from internal record buffer. Though inheritance and overloading the pointer (->) operator very advanced object oriented database access can be performed on your Btrieve files with this class. This class can also has a set of member functions for reading and writing your Btrieve records like a file; Seek, Read, Write, SetSize and GetSize.
  • BTRVTABLE. This class inherits all of the capability of the BTRVDBOBJ class. It provides the ability to read and write your Btrieve data by field name from a DDF. Automatic data conversion to and from strings for any Btrieve data type is also provided. This class also provides a SQL interface to the Btrieve extended operations. The result sets are a virtual list and are fully modifiable; inserts and updates. Other value added features include support for accurate scrolling, and complex find operations via SQL syntax.
  • BTRVMNGR. This class easily handles all of the startup and required shutdown protocols required by Btrieve.

The included C library provides a standard C interface to the C++ class library. The C library is completely object oriented and provides access to the classes via an "object handle". The object handle is the first parameter to every function call in the C library. A complete C interface is provided to all of the classes and their member functions. Constructor functions are provided to create any class and complete multiple inheritance is provided for. Like the C++ class library the C library comes as both static libraries and as a Windows DLL. This means that you can use this library with ANY product that can call a Windows DLL. This can be as diverse as Visual Basic,Delphi, or even Smalltalk. In fact our Data Control for Btrieve Enterprise uses this library for Btrieve Access.

Let's Get Down To Details

What follows are a few code examples. Let's begin with the BTRVTABLE class. This class provides field based access via Btrieve DDF files. Assume an employee record. The record is made up of a first name, last name and salary field.

BTRVTABLE Employee;
int ret;
float Salary;
ret = Employee.OpenDDFTable("c:\empdata", "employee", -3);
// Give everyone a raise.
for (ret = Employee.GetFirst(0); ret == 0; ret = Employee.GetNext())
{
Employee.GetField("salary", &Salary);
Salary = Salary + (Salary * .05);
Employee.SetField("salary", Salary);
ret = Employee.Update();
}

As another example use the BTRVDBOBJ class. This class maintains both the record buffer and key buffers internally. It will also build the key buffers off of the internal record buffer. This class frees you from ever having to define a key buffer structure or pass key or data buffers as parameters. The following overloads the -> operator for direct access to the internal record buffer.

typedef struct { char FirstName[32]; char LastName[32]; float Salary; } EMPLOYEE_REC;

class EMPLOYEE : public BTRVDBOBJ {
public:
EMPLOYEE() { };
virtual ~EMPLOYEE() {};
EMPLOYEE_REC *operator->() { return ((EMPLOYEE_REC *) GetRecPtr()); };
};

int ret;
EMPLOYEE Employee;
ret = Employee.Open("emp.fil", -3);
// Get "Jack Smith's" record.
strcpy(Employee->FirstName, "Jack");
strcpy(Employee->LastName, "Smith");
ret = Employee.GetEqual(0);
// Now access the data
if (ret == 0) {
Employee->Salary = Employee->Salary + (Employee->Salary * .05);
Employee.Update();
}
/* File closed in destructor. */

Of course you can also use the BTRVOAPI class to perform a similar operation. Note that the position block, key buffers and current index are managed internally by the object.

typedef struct { char FirstName[32]; char LastName[32]; } EMPLOYEE_KEY0;
EMPLOYEE_KEY0 Key0;
EMPLOYEE_REC emp;
BTRVOAPI Employee;
int dlen;
ret = Employee.Open("emp.fil", -3);
// Get "Jack Smith's" record.
strcpy(Key0->FirstName, "Jack");
strcpy(Key0->LastName, "Smith");
dlen = sizeof(emp)
ret = Employee.GetEqual(&emp, &dlen, &Key0, 0);
// Now access the data
if (ret == 0) {
emp.Salary = emp.Salary + (emp.Salary * .05);
ret = Employee.Update(&emp, &dlen);
}

How many lines of declarations and standard C code would this have taken? Also consider that you do not need to worry about freeing up memory or closing files. And this is just a very simple example. The following example demonstrates how easy it is to perform a Query. Queries are mapped to Btrieve extended operations for the fastest access available anywhere. Extended operation buffers are built and maintained internally by the EXTEND class. These buffers have been converted into a read\write cache. You can extract the data you want and selectively modify it. The result is a virtual list. As you iterate through the data it will automatically and transparently perform get next or get previous extended operations to retrieve the data required.

BTRVTABLE Employee;
unsigned long Recs;
ret = Employee.ExtQuery("Select salary from Employee where salary >= 10000.00 and salary <= 40000.00");
// Query defined. Now execute operation. Result is a virtual list.
// Get count of how many records are in the set. Note: This is not required for following operations.
Recs = Employee.ExtRecords();
for (ret = Employee.ExtGetFirst(); ret == 0; ret = Employee.ExtGetNext())
{
Employee.ExtGetField("salary", &Salary);
Salary = Salary + (Salary * .05);
Employee.ExtSetField("salary", Salary);
Employee.ExtUpdate(); // Only update salary field of record.
}
// File closed and all memory freed in destructor.

These examples demonstrate only a small part of the capabilities of this library. Many more examples could be given for buffer management, SQL Queries, find operations, extended operations, creating supplemental indexes, logging and of course the normal Btrieve operations. The library combines both great power and a very easy-to-use and intuitive interface. You can achieve orders of magnitude reductions in code and declarations. In addition you also get easy to read self-documenting code. It all adds up to greatly simplified Btrieve database development.

The Btrvgen++ product can simplify your Btrieve development even further. Best of all we offer a special product bundle when your order Btrv++ and Btrvgen++ together. Btrv++ comes with full documentation

  • Item 1
  • Item 2
  • Item 3
  • Item 4
including online help and full source code.


Our products support all Btrieve and Pervasive SQL based applications and tools

Our tools provide support for all versions of Pervasive SQL, Btrieve, and Netware Btrieve (32 or 16 bit). Supported software products include Crystal Reports, Macola, Great Plains Dynamics, Solomon, Platinum, Peachtree, Maximizer, Macess, Lytec Medical and many others. If it is based on Btrieve and/or Pervasive SQL then our products are compatible. Programming tools supported include .NET, Visual Basic, Visual C++, Access, Visual Foxpro, Visual J++, ODBC and OLE DB drivers, Active Server Pages (ASP), VBA enabled applications and many other tools and utilities.

All specifications subject to change without notice.
Data Manager for Btrieve and Pervasive SQL, Developers Toolkit for Btrieve and Pervasive SQL, 32 Bit Power Pack for Btrieve, Classic Data Control for Btrieve, Btrv++, Btrvgen++, DDF Maker, and VBtrv Toolbox Controls for Btrieve are trademarks of Classic Software, Inc.
Btrieve and Pervasive SQL are a registered trademark of Pervasive Software.
Other products and companies referred to herein are trademarks or registered trademarks of their respective companies or mark holders.