Section 11.1.  Defining a secondary data source

Prev don't be afraid of buying books Next

11.1. Defining a secondary data source

As we've learned, every InfoPath form has a primary data source that is either an XML file, a database or a SOAP Web service. This primary data source is the abstract XML document that is retrieved, edited, saved and/or submitted using the InfoPath form.

In completing a form, it is often useful to query or include data from other, secondary, data sources; for example:

  • To validate the value of a field against a list of valid values stored in a database or file

  • To bring in a list of values to be included in a drop-down list

  • To automatically complete information in the form; for example, to fill in the city and state based on the ZIP code.

In InfoPath, this is accomplished by defining secondary data sources and accessing them from scripts. Setting up a secondary data source is not much different from setting up the primary data source.

1. On the Tools menu, click Secondary Data Sources. This will bring up the Secondary Data Sources dialog shown in Figure 11-1.

Figure 11-1. The Secondary Data Sources dialog




2. Click Add. This will bring up the Data Source Setup Wizard, which is also used to set up the primary data source.

3. Choose whether it is an XML file, a database, or a SOAP Web service, and follow the wizard instructions. These instructions were described in greater detail in 9.3.6.3, "Using an XML example", on page 205, 9.3.6.4, "Starting from a database", on page 206 and 9.3.6.5, "Starting from a SOAP Web service", on page 212.

4. When prompted, choose a name for the data source.

5. If the secondary source is an XML file, the wizard will prompt you to add it to the form template as a resource (unless it was previously added using Resource Manager). If you decline, other users of the form may not have access to the secondary source.

Amazon


XML in Office 2003. Information Sharing with Desktop XML
XML in Office 2003: Information Sharing with Desktop XML
ISBN: 013142193X
EAN: 2147483647
Year: 2003
Pages: 176

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net