HOME ABOUT
I AM HERE
Bookmark and Share

Using centrally managed SharePoint data connection files with InfoPath 2007

November 3, 2008 11:06 by Aidan

When deploying InfoPath forms with data connections between environments it is possible to use centrally managed data connection files to make the process a bit smoother.

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):

   <udc:ListId>{175EC1CF-BF41-4848-B775-40277642B99F}</udc:ListId>
   <udc:WebUrl>https://productionurl.co.uk/</udc:WebUrl>

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.


Comments

January 23. 2009 04:25

Nice post- I've refered to it in my post here:
mossipqueen.wordpress.com/.../

Esther

February 4. 2009 13:10

have you ever written code to open a udcx file and update the parameters then save it back to the data connection library? I'm working on a site definition that will include data connection files which have to be updated appropriately after deployment and am looking for tips on the best approach to do this automatically.

Dan

March 12. 2009 17:50

Hi Adian
It's great article, exctly what i was looking for.
I am in the process of moving the infopath browser form with dataconnections from DEV to Production,One of the dataconnections is reading from database.followed the steps you had mentioned, after recreating the dataconnection using the Search for connections on a Microsoft Office SharePoint Server (also changed the Connection Options to Centrally Managed )the dataconnection details still shows the path to the site collection library(Ex:dev1:5555/DConnections/Test.udcx). I moved the form to production and it cannot run because it is looking for the dev1:5555/DConnections path, can you please suggest?Any help is greatly appreciated. Thanks

Lakshmi

March 13. 2009 11:16

Dan - I haven't tried to do that but it should be possible through the object model. Just upload the relevant udcx to the central admin site using a feature receiver that is part of your site definition wsp.

Lakshmi - Are you sure that centrally managed has been selected for this connection? You need to update the properties on each data connection to make sure they are looking for the centrally managed udcx.

Aidan

March 30. 2009 01:07

I have actually written a feature receiver that adds UDCX files dynamically and can add in list id's etc. as the site is deployed. Check it out here:
sharepointdevwiki.com/.../Developing+a+InfoPath+Solution+using+a+Solution+Package

Jeremy Thake

April 4. 2009 06:39

Hi Adian,

I followed all above steps. then I am getting error:
"An error occurred accessing a data source"
even I added administrator login info in the UDCX file.
If I select "Local Data Connection library" then it is running fine.
Any Idea?

Thanks

.NET Dev

May 11. 2009 09:15

Hi Adian,

Just curious? Have you set the infopath trust level to full trust in DEV or TEST?

If you are deploying to Prod you will need a digital cert.

Thanks

Jose

Jose Flores

July 16. 2009 17:26

Hi,
Thanks for the article. I am looking to move all the udcx files in my SahrePoint Library to a NEW SharePoint server. How do I update the URL path specified in each of my data connections in the InfoPath form to the New SharePoint Data Conncetions Library? I cannot delete and recreate each connection. Too many fields depend on each connection. Thanks!

Gail

September 24. 2009 20:59

Pingback from sladescross.wordpress.com

Infopath Create And Use Data Connection Library « Sladescross's Blog

sladescross.wordpress.com

October 7. 2009 00:59

Hi Aidan,
I also have a similiar issue to Lakshmi and have updated each data connection to make sure they are looking for the centrally managed udcx.  Do you have any other suggestions on how to resolve the issue?  Thanks.
Joe

Joe

October 7. 2009 09:13

Joe - have you changed the settings in the udcx on production so that it is looking for the production database?

Aidan

October 30. 2009 14:05

Pingback from workerthread.wordpress.com

Things I’ve Found Out About InfoPath and Forms Services «  The WorkerThread Blog

workerthread.wordpress.com

October 30. 2009 14:16

Pingback from workerthread.wordpress.com

Things I’ve Learned About InfoPath and Forms Services «  The WorkerThread Blog

workerthread.wordpress.com

November 4. 2009 14:02

Pingback from endusersharepoint.com

SharePoint: Things I’ve Learnt About InfoPath and Forms Services | End User SharePoint

endusersharepoint.com

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading