Error while querying the data source - InfoPath Dev
in

InfoPath Dev

Error while querying the data source

Last post 01-18-2012 04:47 PM by azandbergen. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-17-2012 11:19 AM

    Error while querying the data source

    Hello,

    I'm running into some more problems while designing my forms. I am using InfoPath 2010 and SharePoint 2010 Server

    I have a form that gathers information and it has a header section that pre-populates fields with information such as the current user, data, form number etc

    I have two problems with this form:

    1) I try to populate the Office field by querying an SQL database with employee information. I am pulling the current user's real name via a web service and I would do the same for the Office field but we don't store the office information in AD, we store it and other information in an SQL database. So fine, I created a data connection to that database, and it pulls that information from the table. It works perfectly fine in Preview mode, however when I publish and upload to my site and I try to Add Document, it throws a pretty common error (error while querying data source). I've looked it up and it appears to be a pretty common problem but everything people have said and everything in the Event log didn't work to fix the problem.

    I have tried:

    -Changing the form to Full Trust

    -"Allow cross-domain data access for user form templates that use connection settings in a data connection file" is checked

    -I have tried converting the data connection to a file and have it both in a Data Connection Library and under Manage Connection Files

    -I've tried deleting all the connections and re-doing them by re-converting and re-uploading etc. 

    I'm at my wits' end with this problem.. I need to get it working but I just can't seem to do it. If anybody can help in any way I greatly appreciate it.

    2) Another of the fields in the header is a form number. The form number has the following format: "QI-YYYY-###", where YYYY is the year (easy enough to retrieve and filter using substring() and today()..) but I can't figure out the sequential numbering. I've read a bunch of threads and blogs about it but I can't get it to work for me. I don't want to use buttons on my form or anything I just need the form to look up the highest number from the library, and make that form number the next one (taking into account and addressing the fact that two people might open a new form at the same time and get the same form number) and adding leading zeros so that if there are two forms in the library with QI-2012-001 and QI-2012-002 then when the next form is submitted it looks up the highest number and makes the form QI-2012-003 and so on... and then at the new year, the numbering restarts at QI-2013-001. I know I need to use data connections to lookup the highest form number using the max() function and so on but I need to do this without using buttons on the form or anything.. so when the user clicks Submit on the ribbon, it does this look up. I realize these are somewhat complex requirements but if anyone knows ANYTHING that can help me, please let me know!

    Thanks in advance guys & gals :)

  • 01-18-2012 02:25 AM In reply to

    Re: Error while querying the data source

    Hi:

    Sorry about your issue.

    For #1, either you or your admin should approve the UDC file created in the data connection library, or have you done that already?

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 01-18-2012 09:21 AM In reply to

    Re: Error while querying the data source

    Okay so I tried to redo the whole uploading process again so I could start from scratch. I readded the submit method (Submit to SharePoint Library) and redid the Publish options (Administrator-approved form, published to a location on my desktoo) and then went into Central Administration > Manage Form Templates > Upload, and then I uploaded my Form. I then activated it to the site collection, and went to my Form Library settings and added the content type of my form and made it the default. Then to try it out, I clicked +Add Document....and then got this error immediately: 

    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.
    Hide error details
    Correlation ID:754b62b0-df7c-4c29-8404-2b188eb72897

    I don't know what I did wrong.. as far as I can remember, I followed the steps perfectly the get a form to work on my site... I wanted to try and see if could do what you suggested but I can't even get to this step..

    Also, I've been uploading and deleting form templates all day, and the list stays updated in Manage Form Templates. However, when I go to add the content type to my form library, in the list of available content types it still shows all of the other templates that have been deleted already, is there a way to refresh this list??

    i'm so lost right now

  • 01-18-2012 04:47 PM In reply to

    Re: Error while querying the data source

    SOLVED: Instead of using InfoPath's data connections to connect to the SQL database, I just used custom VB code to handle the queries and it's uploading fine now!
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.