Developer Reference : Data Access Methods : ActiveX Controls Guide : Introduction to ActiveX
 
Introduction to ActiveX
The following topics introduce the ActiveX access method:
Overview of the ActiveX Access Method
Choosing the ActiveX Access Method
Key Features of ActiveX Access Method
Zen Features Unavailable in the ActiveX Access Method
First Steps with ActiveX Controls
You can also go directly to more detailed information for using ActiveX:
ActiveX Quick Start
Using Data Dictionary Methods with ActiveX
ActiveX Control Reference
Properties, Methods, and Events By Category
ActiveX Method Reference
ActiveX Event Reference
Overview of the ActiveX Access Method
The ActiveX access method is a set of nine custom controls that enable development environments that support ActiveX to easily access Btrieve data. The interface includes a data source control and eight bound data controls.
The Zen data source control provides the connection point between your application and a Btrieve data file. In addition to acting as a data source for other data-aware controls, the data control also exposes properties, methods, and events you can use to access data from code in your application—opening, closing, and creating files; and retrieving, updating and deleting records.
The Zen bound controls, which must be attached to the data source control, include data-aware text box, list box, combo box, check box and option button controls. The list and combo box controls operate either as field-bound controls or as multi-column record list controls. Command button and horizontal and vertical scroll bar controls provide indexed record navigation.
In Microsoft Visual Basic, the Zen data source control can also act as a record source for data-aware Visual Basic controls, and for third-party data-aware ActiveX controls.
This section features the following subsections:
Development Environments
Third-Party Data Bound Controls
ActiveX Control Objects
Development Environments
The ActiveX access method supports the following environments:
Visual Basic 5.0 and higher
Delphi 3.0 and higher
Visual C++ 5.0 and higher
Embarcadero C++ Builder 3.0 and higher
Note Several other development environments and applications also provide support for ActiveX control extensions. However, Actian Corporation has not tested its ActiveX access method in any programming environments, languages, or applications not specifically listed above.
Third-Party Data Bound Controls
The ActiveX access method can bind data from Sheridan, APEX, GreenTree, and Microsoft Controls. Actian Corporation only recommends using these third-party products when they have formatting or presentation functionality not present in the ActiveX access method.
Because Actian Corporation cannot control the development of third-party software, it does not support all of the functionality of these controls. For the same reason, it cannot offer technical support on these products.
Note Data binding to third-party data-aware controls is not supported in any environment other than Microsoft Visual Basic.
ActiveX Control Objects
The ActiveX control objects included with the ActiveX access method are listed in the following table:
Table 1 Included ActiveX Control Objects 
Icon
Control
Description 
VAccess
The data source control provides your application source code and Zen Bound Controls access to a data file.
VACheckBox
Check box can be bound to boolean (True/False) type fields.
VAComboBox
Data-bound combo box can be bound to one field in a record, allowing the user to select a value for the field from a predetermined set of values. It can also serve as a record list control, or as a list of available index fields.
VACommandButton
Data-bound command button can execute record retrieval, update, or delete operations.




VAHScrollBar




VAVScrollBar
Data-bound scroll bars allow the user to scan through records along an index path.
VAListBox
The list box control allows the user to select a field value from a predetermined set of values. It can also serve as a multi-column record list control.
VAOptionButton
The option button may be bound to a boolean (True/False) type field.
VATextBox
The data-aware text box can automatically display and permit modification of any field. It also can be used in search mode to seek matching records from a file as text is entered.
Choosing the ActiveX Access Method
ActiveX is a Microsoft trademark term for Windows OLE (object linking and embedding) custom controls. Originally developed as extensions to the Microsoft Visual Basic language, they were quickly adopted by Microsoft's other language products, as well as other applications such as Internet Explorer.
If you are creating Windows applications using a language or programming environment that supports ActiveX controls, the Zen ActiveX access method can handle many of the typically difficult or error-prone tasks of data access for you, such as:
Setting up and using file create and extended operations buffers
Providing data translation and field-level access
Maintaining indexed joins between files
In Microsoft Visual Basic, the controls also provide seamless access to data for Visual Basic text box and list box controls, APEX and Sheridan grid controls, and other data-aware objects.
In addition to Visual Basic, other programming environments such as Microsoft Visual C/C++, Embarcadero Delphi, and C++ Builder also provide support for ActiveX controls. Microsoft Visual Basic data binding is not supported outside of Visual Basic, however. If you plan to use the ActiveX access method in these languages and your application requires user interface objects such as text boxes, list boxes, or grids, you will need to use the Zen Data Bound Controls provided in the Zen SDK ActiveX access method or implement the data binding to these within your application code.
When should I consider using the ActiveX Access Method?
The Zen ActiveX access method may be used as an alternative to ODBC access for applications in which database performance is of greater concern than SQL access or database abstraction. It provides many of the same basic data services, but uses the MicroKernel rather than the relational engine.
Key Features of ActiveX Access Method
The ActiveX access method includes a number of key features to make developing applications with Zen.
Data Source for Data-aware Controls in VB
ActiveX can be used as a data source by other data-aware controls in Visual Basic, including third-party controls such as Apex TrueGrid grid controls or Sheridan Data Widgets. The Zen Bound Controls in Visual Basic and in other development environments.
Field-level Access
The ActiveX access method uses data dictionary files (DDFs) to provide field-level access to Zen data. Fields can be referenced by name or by ordinal. All Zen field data types except LVAR are supported.
Property and Method Interface
In addition to the control objects, the ActiveX access method provides a number of properties and methods for programming convenience and flexibility. These properties and methods enable you to set up and execute a number of Zen operations without extensive coding and to manipulate the data in code through interaction with the Zen bound controls, the programming environment, or other third-party controls.
Extended Operations
The ActiveX access method simplifies using Zen extended operations, which provide client/server record set caching, field selection, and record filtering capabilities.
Extended operations provide the means to minimize network traffic when running distributed applications against centralized databases, improve performance, and simplify the implementation of multi-row objects such as grid controls and record lists.
DDFs
The ActiveX access method, like the ODBC interface, requires dictionary data files (DDFs). To create a database with DDFs. See Using Zen Control Center in Zen User’s Guide.
ActiveX DDF Access Methods
The data source includes methods for accessing DDF information from within your application code.
Remote Data Access
In addition to workstation and client/server options, the ActiveX access method can provide access to Zen data using URIs.
Joined Tables
The Join property of the VAccess control allows you to specify that two files are to be linked by a key value, so that any changes in the record positioning of the first file will also affect the records retrieved from the second. The Join property provides a simple mechanism for browsing a relational database.
Zen Features Unavailable in the ActiveX Access Method
The following features are a part of Zen but are not supported in the ActiveX access method.
SQL Syntax
ActiveX provides access to the MicroKernel Engine for a Zen database. The access method does not provide access to the Relational Engine or provide SQL query processing functionality.
Chunk Operations, Huge Records
The ActiveX access method does not support Zen chunk operation primitives. The maximum record size supported by the ActiveX access method is dictated by data dictionary limitations. The fixed record length limit is 4 KB, the combined fixed and variable length maximum is 32 KB.
Creating Files with Multiple ACS
The ActiveX access method does not expose interfaces to allow the creation of new tables with multiple Alternate Collating Sequences (ACS). However, the ActiveX access method will collate these indexes correctly in tables that use them.
Data Types
The following Zen data types are not supported by the ActiveX access method:
LONGVARCHAR
LONGVARBINARY
URI Syntax
Zen ActiveX uses the HostAddress and DatabaseName properties to build a URI for connection to remote machines. However, you cannot specify all the URI syntax parameters using code. If a database is secure, the prompt=yes parameter is used by the ActiveX controls to tell the MicroKernel Engine to prompt the user for credentials.
First Steps with ActiveX Controls
This topic provides you with a quick way to get started. After you perform the tasks here, you should be on your way to developing your application:
Create a database with data dictionary files (DDFs).
Import the ActiveX interface into your development tool (instructions for Visual Basic and Delphi).
Creating a Database
For instructions, see To create a new database in Zen User’s Guide.
Importing ActiveX Access Method into Visual Basic and Delphi
The following procedures show how to import ActiveX controls into your development environment.
Visual Basic
To import the ActiveX controls into a Visual Basic Project
1 Select Projects from the menu bar.
2 Select Components from the Projects menu.
3 Select the Controls tab from the Components dialog box.
4 Select the Zen ActiveX Data Source and Zen Bound Controls options.
5 Click OK.
Delphi
To import the ActiveX controls into the Delphi
1 From the Component menu, select Import Active X Controls. The Active X Control dialog box is displayed.
Figure 1 Import ActiveX Control Dialog Box (Delphi)
2 Select Zen ActiveX Data Source and then click Install.
3 Now you need to import the bound controls. In the Import ActiveX Control dialog box, select Zen Bound Controls and click Install.
The blue ActiveX control icons should now appear in the Delphi Component Palette.