views:

13

answers:

1

I have an InfoPath form which has sort of a master-detail pattern, with two tables in the underlying main datasource. I am trying to migrate this to a new SQL Server - same database, just moved from a SQL2005 machine to a SQL2008 machine.

If I change the servername, it also wants me to change the database and tables. If I select the same database and master table, the bindings are maintains for the master table. But there doesn't appear to be a way to select multiple tables when you change the datasource, so you lose the detail bindings.

Am I missing something - I'm pretty new to InfoPath.

A: 

The easiest way to change database servers (assuming the schema is identical) in InfoPath is to hack it through the backend. We use the same process to script the change of a form from a development environment to production.

If you are using managed code solution the files are in the "InfoPath Form Template" folder. If you are using a regular .xsn file then append .zip onto the end of the file name and extract all the files out to a folder (or you can use cabarc instead of zip).

Edit the manifest.xsf file. There should be a dataobject tag for your server connection information (searching on the server name is the easiest way to find it in the mess). Just change the server name and save the file.

If you are using managed code then you are finished, the next time you open the project it will use the new connection. Otherwise you need to repackage the .xsn file using either cabarc or I think you can just rezip as well.

Note that this edit will not increment the version number of the form since you didn't really use the program to make the change.

Hope that helps - it is a huge pain to do it using the program itself but not too bad to do it manually (and easy to script).

ktharsis