Geeks With Blogs
Josh Meyer fun with .Net

Anything to make my life easier...

As I am fairly new to InfoPath (who isn't?), I'm constantly looking for ways to streamline the process of moving through the development-test-production cycle.  InfoPath stores dataconnection information in the manifest.xsf file that is included in the .xsn solution file when a form is deployed (in my case, published to a SharePoint form library).  This means that if a dataconnection changes, the manifest.xsf has to be updated.  This would seem like a small task, but if everything is not formatted perfectly in this file then the InfoPath form will not even open.  The dataconnection information can be changed through the designer, but if you're doing any XPath filtering of databound controls, when you change the dataconnection you lose all of your filters.  In my case, I am using cascading dropdownlists, and each time I would change the dataconnection I'd have to completely rebuild the “cascading” effect.  Anyway, in my opinion, the best (and easiest) way to manage dataconnections in InfoPath is using File DSNs.  So here are the steps...

  • Add the dataconnections through the designer as normal (Tools-Data Connections...)
  • Create File DSNs (Administrative Tools-Data Sources(ODBC)) to mirror dataconnections in the InfoPath form
  • Open the manifest.xsf
    • If you're working in Visual Studio, you can just open the file directly (make sure you close InfoPath first)
    • Otherwise, you'll have dig into the .xsn file (it's basically a CAB file, I think) and find the manifest.xsf
  • Find the entry in the manifest.xsf for each dataconnection, and replace the connectionstring value with “FILEDSN=pathToYourDSNFile“ .  So the connectionstring attribute should look like this:

 connectionstring=“FILEDSN=pathToYourDSNFile“

That's it!  Now you should be able to change your dataconnections without completely screwing up your InfoPath form.  Special thanks to Ken Sproule at MindSharp for putting me on this!

Posted on Thursday, September 15, 2005 3:52 PM InfoPath | Back to top


Comments on this post: InfoPath - storing data source connection information in File DSN

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Josh Meyer | Powered by: GeeksWithBlogs.net