Published Form: An error occurred accessing a data source. - InfoPath Dev
in

InfoPath Dev

Published Form: An error occurred accessing a data source.

Last post 01-19-2010 06:55 AM by George.Gergues. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 02-17-2009 10:41 PM

    • dust_w
    • Not Ranked
    • Joined on 02-18-2009
    • Posts 2

    Published Form: An error occurred accessing a data source.

    Hi everyone!

    This is my first post, so I hope it all makes sense.

    I'm relatively new to InfoPath, but having a development background I've picked up on the basics quite quickly.

    What I have recently been trying to achieve is to create a Sharepoint form, which will have pre-populated data based on what the user selects in a drop down box.

    I found an excellent solution today (http://www.infopathdev.com/blogs/matt/archive/2006/04/18/Automatically-Populate-Fields-from-a-Drop_2D00_Down-Selection.aspx - absolutely fantastic article by the way) which sets up an XML file as a secondary data source, and pulls the information from there. This is then linked to a drop down list, which when something is selected, it fills in the subsequent fields (name, extension, username).

    When working with this form in InfoPath - everything appears to be fine, I use the preview functionality and the form information pre-populates perfectly, depending on what I choose in the drop down. However, when I publish the form to Sharepoint, the form loads with an error:

    There has been an error while processing the form.
    Click Continue to resume filling out the form. You may want to check your form data for errors.
    Click Start Over to load a new copy of the form.
    Error Details: An error occurred accessing a data source.


    I click the Continue button and the form is displayed, but I have nothing in my drop down list or in any other fields. It's like the XML data source is not found or can't be found.

    Now before you ask, when I setup the XML file as the Data Source I did select the option to "Include the data as a resource file in the form template or template part". Which subsequently added the file to the Resource Files list (Under the Tools menu). One thing I found odd though, and I can't find any information on this, is when I'm in Sharepoint, in the Form Document Library and I select Actions > Open with Windows Explorer, I cannot find the XML file here at all. I don't know if this is the problem, but I thought I'd mention it.

    Also another note, the XML file is about 2MB in size as it contains about 2000 odd records - could this be a problem? What are the limits (if any)? Is there any other suggestions on how to get around this?

    If you need any more info or have any questions I'll be more than happy to clarify! Thanks again.

    Cheers,

    Dustin

  • 02-17-2009 11:11 PM In reply to

    Re: Published Form: An error occurred accessing a data source.

    Hi Dustin and welcome!

    Wow, now that sure sounds like an InfoPath bug. What version are you running? Can you reduce the size of the XML data source and try it with a 100k or 200k size file? If that works, keep adding to it until it is broken. Laborious, I know, but I've never heard of this issue.

    You can also add the XML file first and then set up a data connection to it. You might try that to see if you can skirt around the error.

    Finally, make sure that the XML data source has the correct UTF encoding processing instruction and that it doesn't have any corruption at the end of it.

    I don't understand the Actions -> Open with Windows Explorer. You should be publishing the form to a "Form Library" not a pure Document Library (I know Form Libraries are derivates of Document Libraries). Check to make sure it is a form library that you created. Create a new one and make sure you choose Form Library and not Document Library.

    Good luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 02-19-2009 04:22 PM In reply to

    • dust_w
    • Not Ranked
    • Joined on 02-18-2009
    • Posts 2

    Re: Published Form: An error occurred accessing a data source.

     Hi Patrick,

     Thanks for the quick reply.

    To answer your question I'm using Infopath 2007 SP1 (Actual version 12.0.6214.1000). I did as you asked, and reduced the size so that it worked, then gradually increased it. I found the threshold and removed some unnecessary fields in the XML file which were obviously clogging it up a little. This now works like a charm, thanks.

    As for the last query, the form template is published to a Form Library, not a document library.

    Now all appears to be okay, however there is now a niggling issue when the form loads up. I am getting an error:

    Stop running this script? A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive.

    If I click NO, nothing really happens, if I click YES, then the message goes away, and the form works as it should. 

    I've searched around the internet for an answer, apparently theres an option to turn off (Tools -> Internet Options -> Advanced - Check the ‘Disable script debugging (Internet Explorer)' and ‘Disable script debugging (Other)' checkboxes to avoid script error in your form) however this is not really a feasible option as the form is expected to be completed by 2000+ users, and we cannot change this option for all of them.

    If this is unavoiable due to the XML data source being so big, are there any alternatives? I've read in other places about setting up a web service to interact with a sharepoint list, but I cannot find any further information on this, nor (given that I am not a Sharepoint administrator at the company I work for) would I have the account priveledges to create this. 

    Thanks again for your help!

    Cheers,

    Dustin

     

  • 09-21-2009 07:43 AM In reply to

    • brhodes
    • Not Ranked
    • Joined on 10-05-2007
    • Atlanta, GA
    • Posts 6

    Re: Published Form: An error occurred accessing a data source.

    Dustin,

    Did you ever get a solid resolution to this issue? I have got the same problem...

     Bruce

  • 10-12-2009 01:34 PM In reply to

    Re: Published Form: An error occurred accessing a data source.

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

    This ambiguous error message( very common if you are developing with Microsoft products  :o)  )  is always related to an unterminated Dataconnection

    Meaning, You might have a data connection that is not bound to any field.

     

    How to fix :

    1.       Open the Form to design view in InfoPath .

    2.       Got to Tools - > Data Connections.

    3.       Find out which control is not being used , if you designed it you would know.

    4.       Or start assigning those to static text field one at a time and find the one that breaks.

     

    Good Luck coding

    -George Gergues

  • 11-04-2009 02:11 PM In reply to

    • Barb09
    • Not Ranked
    • Joined on 11-04-2009
    • Posts 3

    Re: Published Form: An error occurred accessing a data source.

    The Edit SQL dialog can be used to 'filter' data when building a data connection in InfoPath.  There should be some criteria in your SQL data that you can use to create several of these 'filtered' connections instead of one large connection.  Instead of my On Form Open 2000-record data connection that caused errors, I ended up with seven data connections to the same SQL data, each pulling from 15 to 80 records.  A major improvement that got rid of the script error.

    Instead of bringing in all of the SQL data on Form Open, create dropdown list controls where the user selects their criteria to filter against (e.g., first their Country, then their State, etc.).  Then, add button controls (one for each connection), all hidden except the one they need.  Each button runs one 'filtered' connection, giving the user a smaller set of data filtered to what they need (e.g., just 40 records for California - not 2000 global records).

     

  • 01-11-2010 08:24 AM In reply to

    Re: Published Form: An error occurred accessing a data source.

    Hi,

    Sorry to start this up again, but I am getting a similar issue in that I have a drop down list that uses an xml file (created from another sharepoint list: http://.../admin/_vti_bin/owssvr.dll?Cmd=Display&List={F6B3160A-A870-4AD9-AAA1-07779C7F8CC7}&View={E420C6BE-F034-40F6-B0AC-18041AE8E0CF}&XMLDATA=TRUE). The list is generated everytime the form is opened as the list is constantly being added to.

     As the orginal issue, the drop down works fine in the infopath preview but when its published to sharepoint I get and warning box with the error: An error occurred accessing a data source.. I click continue and the form opens with everything but this drop down box working as it should.

    Any ideas?

    Jeni

  • 01-11-2010 03:17 PM In reply to

    Re: Published Form: An error occurred accessing a data source.

    Hello JeniEck

    I know this sometimes get frustraing due to the fact that there is no logging or error tracking or code tracing even.

     So here is what you can do to help find more details.

    [1] Do you get any errors when you run Design Checker ( inclduing warnings ) ?

    [2] Do you get any  errors running the logic inspector ( from tools ) missing variables should be in red ?

    [3] Do you get any errors deploying the form on the form server ?

    [4] Do you have any declared Variables on the form that are not on any view and not assigned a default value ? ( that is most common issue).

     

    Let me know if you would like to share the form and I can have a look at it.

    thank you 

    -George Gergues

    -SharePoint Architect.

  • 01-12-2010 12:39 AM In reply to

    Re: Published Form: An error occurred accessing a data source.

    Thanks George,

    I forgot to mention that this form was previously working fine and I have just discovered that the server has recently had its .net framework upgraded. Is this something that may cause this problem?

    I know that its only the one field on the form that is causing the problem (as if I publish the form without it it is fine). This is a drop down list using a data connection created using the url in my above post.

    When the url is put directly into the browser on both the server and from a users machine it returns the correct xml.

    Jeni

  • 01-12-2010 06:11 PM In reply to

    Re: Published Form: An error occurred accessing a data source.

    Does the error have any additional detail? Does this occur when opening in the browser? Have you tried opening the published form in the client to see what happens?

    Hilary Stoupa

  • 01-19-2010 06:55 AM In reply to

    Re: Published Form: An error occurred accessing a data source.

    Jeni,

    I am guessing that the xml stream gets cached at a folder somewhere ( c:\windows\temp ) or somewhere else.

    and the most common issue would be that the application pool account does not have read/write access to it..

     

    I am speculating that is the only reason,as you had mentioned it used to work before and now it does not.

    Check it and let me know if that is the case .

    I do apologize for for the delayed response.

    George Gergues

Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.