OfficeXMLRef
About secondary data sources

Microsoft Office InfoPath 2003 Service Pack 1 adds the ability to connect multiple data sources to a form simultaneously. Using multiple data sources in your forms allows you to build complex functionality such as lookup lists or offline data stores.

Main and secondary data sources

The main data source corresponds to the groups and fields containing the data that underlies the form and is saved as the form file.

A secondary data source is used to store data from additional data sources. Whenever a new data connection is created for retrieving data—for example, by using the Add button of the Data Connections dialog box—the retrieved data is not stored in the main data source but in a secondary data source. The secondary data source receives the data from any data connection used for querying, whether it is an XML document, a database, a Web service, or a SharePoint library or list.

The Data Source task pane displays the structure (groups and fields) of each data source, both main and secondary, and is used for binding groups or fields in the data source to controls in the form. When a user fills out the form, the controls display the data from the data source and allow it to be updated during editing.

New features for working with secondary data sources

The following sections describe the changes made to working with secondary data sources in InfoPath Service Pack 1.

The Data Connections dialog box

The Secondary Data Sources dialog box, which was accessed from the Tools menu, has been replaced by a new Data Connections dialog box that provides a single place to manage all data connections. The data connections are of the following types:

  • The main connection for a form, which is created by using the New from Data Connection command in the Design a Form task pane.
  • Data connections used to retrieve data, which are associated with secondary data sources.
  • Data connections used to submit data.

The Data Connections dialog box allows you to add data connections for submitting or retrieving data, modifying existing data connections, and removing existing data connections. It also displays a summary of the current settings for each data connection.

Data Source task pane

The Data Source task pane in InfoPath Service Pack 1 provides a drop-down list of available data sources, so that both the main data source and secondary data sources can be displayed. Groups and fields from secondary data sources can be dragged onto the form, as can groups and fields from the main data source, to create controls for displaying or editing their data.

Fields and groups

A drop-down list similar to one in the Data Source task pane is available in other situations in which the user can choose a group or field. For example, it is now possible to choose a field or group from a secondary data source when doing the following:

  • Changing the binding on a control in the view.
  • Setting conditions for data validation.
  • Setting conditions for conditional formatting.
  • Setting the data to be submitted as parameters to a Web service.
  • Inserting formulas.
  • Setting conditions in rules.

Note   Data in secondary data sources is not saved with the form, so making secondary data sources editable in the form makes sense only in certain scenarios. You can display high-level secondary data source content simply by dragging a high-level secondary data source node from the Data Source task pane into the view and choosing Section with Controls. Text boxes can be made read-only, if needed.

Controls available for binding to secondary data sources

The following controls can be bound to secondary data sources with no restrictions on their behavior:

  • Date Picker
  • Drop-Down List Box
  • Ink Picture
  • List Box

The following controls cannot be bound to secondary data sources:

  • Custom Controls
  • File Attachment
  • Master/Detail
  • Optional Section

The following controls can be bound to secondary data sources, but with some restrictions on their behavior:

ControlBehavior
Check BoxAll features enabled, except that the value of the Default state property of the control is Cleared and cannot be changed
Choice GroupNo insertion, deletion, or replacement of groups
Choice SectionNo insertion, deletion, or replacement of sections
Linked PictureNo browsing
List (Bulleted, Plain Numbered)Can edit text, but cannot add items
Option ButtonAll features enabled, except that the This button is selected by default property check box is cleared and disabled
PictureNo browsing
Repeating Choice GroupNo insertion, deletion, or replacement of groups
Repeating Recursive SectionNo insertion, deletion, or replacement of sections
Repeating SectionNo insertion, deletion, or replacement of sections
Repeating TableNo insertion, deletion, or replacement of rows
Rich Text BoxRead only
SectionNo insertion, deletion, or replacement of sections
Text BoxThe Enable spelling checker and Enable AutoComplete check boxes cannot be turned off




Page view tracker