|
This section discusses how to install and manipulate the ActiveX interface with Delphi. The tasks are as follows:



Set the Btrieve file properties on the File Information tab as follows:

Setting this property False prevents the currently selected list box item from automatically scrolling to the top of the list if the list is used as an auto-fill record list (VARecordList = True)
The default behavior of the record list VAListBox (VARecordList = True) is to keep the current record as the first item in the list box, whether or not the positioning was changed by the list box or by other means, such as a scrollbar or a GetEqual command.
If VAAutoScroll is False, this default behavior is defeated and the VAListBox moves the current record to the top of the list only when positioning is changed by a source other than the list box itself. For example, clicking on an item in the list box will reposition the VAccess control, but will not change the items in the list box.
Setting this property True changes the mode of the list box or combo box control from a field-bound control to a record browser.
The VARecordList property causes the list control to be filled with as many records as it can hold. The top item of the list is the current record (unless the VAAutoScroll property is set to False, in which case the selected list item represents the current record.
When VARecordList = True, several added features are available and may be accessed at design time via buttons on the property page. The VAFieldName and VAFormat properties, which are limited to one entry when the control is in field-bound mode (when the VARecordList property is False), can contain a list of fields and formats, respectively, separated by semicolons. In addition, the VAAutoScroll and ColumnWidth properties become active.
Setting this property to true causes the VAccess control to perform a GetGreaterOrEqual method using the value in the text box for the first segment of the index specified by the IndexNumber property of the data source each time the text changes. The setting of the VAFieldName property is ignored.
The Join property of the VAccess control allows you to specify that two files should be linked by a key value, such that any changes in the record positioning of the first (master) file will also affect the records retrieved from the second (slave) file. The Join property provides a simple mechanism for browsing a relational database.
The joined fields in the slave control must be index fields and must contain the same raw data as their corresponding fields in the master control. The fields in the master control do not have to be indexes. The IndexNumber property of the slave control must remain set to the index involved in the join or the join will be broken.
One-to-one, many-to-one, and one-to-many joins are all supported. Note that a one to many relationship is most effective if the ExtendedOps property of the slave VAccess control is set to True. In this case, the slave control automatically retrieves all records which match the key value in the master control, and makes the field data available through its RowColumnValue property. The data can be displayed in a VAListBox in record list mode by setting its VAccessName property to the name of the slave control and its VAFieldName property to the fields to be displayed.
In the Delphi 3 IDE, view the form containing the ActiveX control, right-click on the control, and select Properties from the pop-up menu, or double-click on the control.
|
Chapter contents
Prev topic: Advanced Pervasive.SQL Tutorials Using Delphi
|