BindingCollection Object (VB6)

Description

The BindingCollection object—as the name suggests—is a collection of Binding objects. The BindingCollection object plays a central role in the new data-binding technology in VB6, allowing you to automatically map data fields to standard form controls and to specify formatting for those data. Your application can have any number of BindingCollection objects, each referring to a distinct data member provided by a data source such as an ADO recordset or a VB data source class. The Binding objects held within the class represent the individual mapping of consumer control property to data provider field, a relationship created using the BindingCollections Add method.

The relationship between the various data binding elements is shown in Figure 7.1.

Figure 7.1. How data-binding elements relate to each other

For an overview of data-binding objects, including the library reference needed to access the object model, see the Data Binding Objects entry.

Createable

Yes

BindingCollection Properties

Count

Data Type: Long

The number of Binding objects in the collection.

DataMember

Type: DataMember

An optional string specifying the data member to use from the data source. This is useful where the source provides more than one data member. A DataSource application can provide many data members; you need to create a BindingCollection object for each data ...

Get VB & VBA in a Nutshell: The Language now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.