How do i query a secondary SQL data connection. - InfoPath Dev
in

InfoPath Dev

How do i query a secondary SQL data connection.

Last post 12-17-2012 12:57 PM by Hilary Stoupa. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 03-23-2011 07:33 PM

    How do i query a secondary SQL data connection.

    I am creating a Quote Form that pulls existing quoting information from a SQL back end. This form has two parts the first pulls client information from one SQL table and the second pulls the line items from another SQL table. What's falling apart is that I do not understand how to query the second SQL data connection. To create the form I used the Database Template and created the main data connection. After adding the Query field and the Data fields to the form, I was able to enter a quote number and return the client info for that quote. The issue comes in when I create a secondary data connection, I only see data fields and no Query fields. What I was hoping to do is pass the Quote number to both queries. From what's been posted on the forums I can do this with code behind but would rather not, as I'm unfamiliar with coding. Could someone point me in the direction of a good posting or tutorial that would show me how to query the second data source? Thank you very much. Steve
  • 03-28-2011 06:29 AM In reply to

    Re: How do i query a secondary SQL data connection.

    Hi Steve,

    You can't filter SQL rowsets using a passed in parameter. InfoPath doesn't support passing query parameters to SQL. You can hardcode it in the SQL data connection and then use code to modify but as you say that's just not a great solution.

    We recommend using a Web service to do this. In fact, we developed DBXL back in 2005 to plug this gap and others. Free trial from the qdabra dot com site. You can install this and do your parameterized query. Piece of cake.

     

    Patrick Halstead
    Project Manager at Qdabra
  • 03-28-2011 02:55 PM In reply to

    Re: How do i query a secondary SQL data connection.

    Patric thank you for the responce.  Though I did figure out that I could incude the second table in the original data connection and acheave the same results. 

    Thank you for your help,
    Steve

  • 12-13-2012 09:29 AM In reply to

    Re: How do i query a secondary SQL data connection.

    Hi Steve I'm trying to do exactly the thing as you did but cannot figure out how to query my SQL database can you please tell me how you managed to connect to query your database? Thanks, Brenda
  • 12-15-2012 08:23 AM In reply to

    Re: How do i query a secondary SQL data connection.

     Are you having issues connecting to a database in InfoPath or connecting to multiple databases?

  • 12-17-2012 11:28 AM In reply to

    Re: How do i query a secondary SQL data connection.

    I am connecting to a single sql database but I cannot pass a parameter to the database - I'd like to query the database but there are no query fields.
  • 12-17-2012 12:45 PM In reply to

    Re: How do i query a secondary SQL data connection.

    When you creat a new form you have to select Database.  This will allow you to connect to the database and query the tables. 

    When creating a new form select File --> New --> Advanced Form Templates --> Database. 

    If you are speaking about adding a secondary data once you have created a form and then querying it, I'm at a loss on that one.  I'm tying to figure it myself. 

  • 12-17-2012 12:49 PM In reply to

    Re: How do i query a secondary SQL data connection.

    Yes that is exactly what I'm talking about I can connect to my database and table but I want to send a parameter and get one record out without the form loading all the records I'll put a post out see if anyone can help.
  • 12-17-2012 12:57 PM In reply to

    Re: How do i query a secondary SQL data connection.

    InfoPath doesn't support this out of the box. You can write custom code for this or use a third party tool (like DBXL web services or qRules).
    Hilary Stoupa

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