Uploading data connection files to a Data connection library allows InfoPath form templates to use the data sources described by these files to retrieve and submit information.
To Create a SharePoint Data Connection Library
- Browse to an Office SharePoint Server 2007 or Office Forms Server 2007 site on which you have at least Design rights. If you are on the root site, or portal, go to the Document Center or create a new site before proceeding to the next step.
- Click Create on the Site Actions menu.
- On the Create page, click the Data Connection Library link in the Libraries section.
- On the New page, type a name for the library and click the Create button.
- Copy the URL of the new library.
To Create a New Data Connection File in InfoPath
- Open Office InfoPath 2007 and click Design a Form Template.
- On the Design a Form Template dialog box, click Blank and click OK.
- On the Tools menu, click Data Connections.
- Click the Add button.
- In the Data Connection Wizard, click Create a new connection to and Receive data.
- Click Next.
- Click the type of data source you are connecting to, such as Database, Web service, or SharePoint library or list.
- Click Next.
- Configure your data connection as needed to retrieve data. Once the Data Connection Wizard is completed, choose this data connection in the Data Connections dialog box.
- Click Convert.
- On the Convert Data Connection dialog box, enter the URL of the data connection library that you previously copied.
- Delete “Forms/AllItems.aspx” in the URL.
- Enter a name for the data connection file at the end.
- Click OK.
- Confirm that the data connection has been converted successfully by examining the Details section of the Data Connections dialog box while the converted data connection is selected.
- Browse to the SharePoint data connection library and, if necessary, Check In and Approve the UDC file created.
To set up a centrally managed data connection do the following:
From your InfoPath form select Data Connections… from the Data menu
Select the data connection you want to make centrally managed and click the Convert button
A .udcx file will be created in a site collection data connections library you select so it may be necessary to set up a data connections library first
Navigate to the site collection data connections library and save the .udcx file locally
Go to SharePoint Central Administration – Application Management – Manage Data Connection Files
Upload the .udcx file to the central data connection files library
Go back to the InfoPath form and remove the existing data connections.
Recreate the data connections using Search for connections on a Microsoft Office SharePoint Server
Create the connection using the .udcx file that was saved to the site collection data connection library but make sure that you click on Connection Options… and select Centrally Managed
Configure the controls on the form to use the data connection as normal
The form will now use the centrally managed data connection. To deploy to another environment (eg. UAT, Production) you will need to upload the .udcx file to the relevant SharePoint Central Administraion after altering it to use the connection properties relevant to the new environment. To update the .udcx file open it in a text editor and alter the following parameters (example is for a connection to a SharePoint list):
Where ListId is the SharePoint list id and WebUrl is the url of the site collection that holds the SharePoint list.
When you deploy your InfoPath form it will reference the centrally managed .udcx file allowing it to seamlessly connect with data in the new environment.