How to Configure Form Service/InfoPath to allow external SQL Data Connection


Recently lots of Microsoft partners and customers are interest in the Form Server/Form Services in MOSS 2007. It will enable us to render our InfoPath forms into web page to make our clients access and submit it at everywhere(including using mobile devices).


 


One of the basic steps of that is to configure it correctly, and in most situations, the form content is needed to connect to other data source such as SQL Server. So, here is the basic step about how to configure Form Service/InfoPath to allow external SQL Data Connection:


 


1.    Make sure your form template is marked as “browser-enabled” in “Tools >> Form Options…”


2.    Then you need to convert your data connection file to be stored in  the DCL(Data Connection Library, you can create this list type in SharePoint v3) and enable cross-domain data connections on your server. (You can see the “Convert” button after creating a new Data Connection file)


3.    Create your form content using the data connection file stored in DCL


4.    When you’re publishing, make sure you check the option for browser-enabling the form template on the server.


5.    After published to SharePoint, you can see the form content which data is from external SQL databases in form web page.


 


Alternatively, you can make your form full trust, admin deploy it, and ensure the service account has permissions to your SQL Server database.


 


There are still more documents about this: http://msdn2.microsoft.com/en-US/library/ms772101.aspx


 


More reference are as below:


 


http://blogs.msdn.com/infopath/archive/2006/10/02/Data-Connections-in-Browser-Forms.aspx


http://blogs.msdn.com/infopath/archive/2006/06/14/advanced-server-side-authentication-for-data-connections-part-1.aspx


http://blogs.msdn.com/infopath/archive/2006/06/27/advanced-server-side-authentication-for-data-connections-part-2.aspx


http://blogs.msdn.com/infopath/archive/2006/07/03/655611.aspx


http://blogs.msdn.com/infopath/archive/2006/10/30/the-anatomy-of-a-udc-file.aspx


 


Addition: Lots of friends were asking for how to submit form data directly into the SQL Server via Form Services/Form Server, please refer my latest blog for this scenario: http://blogs.msdn.com/dipper/archive/2007/07/11/about-submit-infopath-form-data-to-microsoft-sql-server-database.aspx