"The form cannot run the specified query" error message in an InfoPath 2010 form after you upgrade to SharePoint Server 2010

Article translations Article translations
Article ID: 982245 - View products that this article applies to.
Expand all | Collapse all

SYMPTOMS

Consider the following scenario.

  • You want to populate a field on a Microsoft InfoPath 2010 form with data from a particular view of a Microsoft SharePoint Server 2010 list. For example, you want a drop-down menu of products on backorder.
  • On the SharePoint server, this menu is a filtered view in your list of all products.
  • You create a browser-enabled InfoPath 2010 form by using Microsoft InfoPath Designer 2010 or Microsoft Office InfoPath 2007.
  • In that form, you create a data connection to an .xml file, and then you set the location to a changed URL that specifies the column and the view.
  • For this data connection, you enable Access the data from the specified location.
  • You publish the form to a Microsoft Office SharePoint Server 2007 site and the form works as expected.
After you upgrade to SharePoint Server 2010, the data connection fails, and then you receive the following error message: 
There has been an error while loading the form.

Click Try Again to attempt to load the form again. If this error persists, contact the support team for the web site.

Click Close to exit this message.
If you click Show details, you receive an error message that begins with the following text and contains a URL address:
The following location is not accessible.
The URL resembles the following address:
http://pathToSharePointSite/_vti_bin/owssvr.dll?Cmd=Display&List=listID&XMLDATA=True&FilterField1=nameOfFieldToFilter&FilterValue1=theValueToFilter&noredirect=true
Additionally, the following error message is logged:
The form cannot run the specified query. The remote server returned an error: (400) Bad Request.

WORKAROUND

To work around this problem, follow these steps:
  1. Open the form template in InfoPath Designer 2010.
  2. On the Data tab, click Data Connections.
  3. Select the data connection that was listed in the error message, and then click Modify.
  4. In the URL field, append the following text to the end of the URL:
    &noredirect=true
    The URL should resemble the following:
    http://pathToSharePointSite/_vti_bin/owssvr.dll?Cmd=Display&List=listID&XMLDATA=True&FilterField1=nameOfFieldToFilter&FilterValue1=theValueToFilter&noredirect=true
  5. Complete the Data Connection wizard, and then republish the form.

MORE INFORMATION

For more information about how to populate an InfoPath 2010 form with data from a SharePoint list data connection, visit the following Microsoft Developer Network (MSDN) page:
Populating form data from SharePoint list views 

Properties

Article ID: 982245 - Last Review: July 15, 2010 - Revision: 3.0
APPLIES TO
  • Microsoft SharePoint Server 2010
  • Microsoft Infopath 2010
Keywords: 
kbforms kbexpertiseinter kbtshoot kbsurveynew kbprb KB982245

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com