InfoPath cannot connect to a data source when viewed in browser – Cross Domain Issues – Universal Data Connection

InfoPath cannot run the specified query.

InfoPath cannot connect to the data source.

Access is denied.

One of the big issues with InfoPath Forms is its error reporting. It could sometimes piss you off. It says there is a problem that is it! We have to spend lot of time clicking and clicking and clicking buttons all over trying to find where is the problem. May be that is how these tools should work…

Steps to go with when you get the above error:

  1. The above error seems to be quite often and it hints that there is some problem with the ‘Data Source/Connection’. If the form is showing the error while loading i.e form never loads but shows a message to ‘continue or start over’, then there is some problem with the data source which is set up to ‘Automatically retrieve data when form is opened’.
  2. If the above is the situation then open up the Data Sources window (Tools – Data Connections) and make sure that the data connection is set up properly and the data source is in place, working and serves requests.
  3. If the above error is shown when user does some action like clicking on button, then check the Rules in the properties of that control (button) and check for those data sources/connections.
  4. If the form works fine when previewed as an application but throws the above error after publishing to SharePoint site or when viewed as a browser form, then most probably the problem will be with the cross domain issue. If the InfoPath is trying to query or submitting to a web service (could be any other data source) and that web service is hosted as http://xyz.com/service.asmx and the sharepoint site is hosted as http://abc.com then thats called a cross domain issue. The infopath form is trying to talk to a service which is hosted in a different domain and it can’t trust it. This can be solved by giving full trust to the form(Tools – Form Options – Security and Trust) but its not the right way to go and your SharePoint admin might restrict that. The only way to go is setting the security and trust to ‘Domain’ and converting the existing data connections or just the cross domain connections to Universal Data Connection (UDC) format. Its very simple to do and gets rid of any cross domain issues. To create UDC connections read this article. For those who have no patience to read the article, below are the quick steps involved:
    1. If Universal data connection document library doesn’t exist in the SharePoint site then create one or request your admin to create one and give you proper rights for you. (Go to ‘View all site content’ – Create – Universal Data Connection Library)
    2. Open up the InfoPath forms Data Connections window, select the cross domain data source connect and then click the ‘Convert’ button and follow the wizar. You need to provide the above created UDC library along with a name for the file for example: http://abc.com/udclibraryname/sampleudc.udcx
    3. Now that is not enough, either you or your admin should approve the sampleudc.udcx document created in the UDC library.
    4. Re-publish the InfoPath form to SharePoint and test it.
  5. In central administration, under InfoPath Forms Services configuration, there is a checkbox to allow cross-domain issues. I am not sure if this is done then above UDC is still required or not. I will update as I learn about it.

More links worth to read:

7 Responses

  1. hi…working with udc files is working fine for me (admin)…I recently added a user to our org and cannot make the ‘final’ connection to run simple queries…strange thing is that his user can jump into design mode and the query runs…just cant get to 1st base from opening the form off the portal…I see the data connection loading window popup- but craps out with

    InfoPath cannot run the specified query.

    InfoPath cannot connect to the data source.

    Access is denied.

    this user can definitely access the tables…and can access the tables via design mode…I’m at a loss

  2. Hi-

    I have created a webservice which populates two drop downs. They work fine when previewing, but have this problem when I publish them. I went through the steps above, but I don’t know what step 4 or 5 are. Can you help me by telling me how to do it?

    I’m getting an error saying the following…….

    An error occurred accessing a data source.

    An entry has been added to the Windows event log of the server.
    Log ID:6932

    ——————————-
    An error occurred accessing a data source.

    An entry has been added to the Windows event log of the server.
    Log ID:5566

    PLEASE HELP

  3. Lets say your webservice url is http://somesite.com/ws.asmx
    and the sharepoint site to which you published is http://sharepointsite.com

    The form which is under the sharepointsite.com domain is trying to read/ping the webservice which doesn’t belongs to the same domain, so it is not trusted and so the request fails.

    As said in the above article:
    -set the form to full trust
    -InfoPath Forms Services configuration in central admin: select the Allow cross domain issues.
    Try these steps skipping the 4th item. If this doesn;t work then you have to read more about the UDC library.

  4. If you are getting “access denied error” then just open the your InfoPath form in design mode

    Tools-> Form Options -> Go to “Security and trust”
    uncheck automatically determine security level

    and check the radion button “Full Trust”

  5. Hello Sir
    Thank you about this article
    u solved my problem very well
    with best regards

  6. [...] If the InfoPath is trying to query or submitting to a web service (could be any other data source) and that web service is hosted as http://xyz.com/service.asmx and the sharepoint site/SQL database is hosted at another server box (e.g  http://abc.com). The InfoPath form is trying to talk to a SharePoint/databaes service which is hosted in a different domain server that can’t trust the other server hosting the infopath service. This probem is known as “Cross Domain Issues“. [...]

  7. I am using a hosted Sharepoint site and I am trying to connect to a SQL database stored locally on my computer. The weird part is I had this working a couple days ago and now when I try to publish a new form to the sharepoint site my drop downs are no longer able to populate from the database. There are no trust issues and the only thing I have changed is the database. I have even tried re-tracing my steps but nothing seems to work. My infopath form works fine, but when I try to run it in a browser I get the “There has been an error while processing the form.” Log ID 6932. What could really help is locating the additional information about this error, which is not in the event log as described.

Leave a Reply