Instead of altering the actual (relative) udcx file I would like to change the data connection source url property, which points to the udcx file, at run time.
The desire is that within infopath form services, at run time, the url pointing to the data connection udcx file is replaced with one relative to where the form was opened. This would enable the same form template to be deployed many times within the same site and each point to their very own data sources, e.g. a contacts list.
If you can imagine a site collection which has four sub sites. A form has been deployed to the site collection. With in each of the four sub sites a form library has been created (e.g. bookings) with the same name. Also in each of the four sub site a list has been created, again all with the same name (e.g. contacts). To connect the form to the contacts list a data connection has been created and converted to a data connection file (udcx). In each sub site a data connections library has been created with the same name (e.g. data connections). Before the data connection file is added to each data connection library, the list GUID and site url is changed. Unfortunately, within the form, the url pointing to the data connection file is relative from the site's root rather than the position of the form at run time. And this all mean you can't point it at multiple connection files within the same site, which is a big problem for the solution im working on. If you could change this url at run time in anyway (e.g. code) then this BIG problem would be solved.
If anyone has any thought i would be most grateful.